How to use the hops-config.browsers function in hops-config

To help you get started, we’ve selected a few hops-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xing / hops / packages / build-config / sections / module-rules / postcss.js View on Github external
sourceMap: true,
};

var cssLoaderLocalOptions = Object.assign({}, cssLoaderGlobalOptions, {
  modules: true,
  localIdentName: '[folder]-[name]-[local]-[hash:8]',
});

var postcssLoaderOptions = {
  ident: 'postcss',
  plugins: [
    require('postcss-import')({
      addModulesDirectories: [].concat(hopsConfig.moduleDirs),
    }),
    require('postcss-cssnext')({
      browsers: hopsConfig.browsers,
    }),
  ],
};

exports.build = {
  test: /\.css$/,
  oneOf: [
    {
      resourceQuery: /global/,
      use: ExtractTextPlugin.extract({
        fallback: 'style-loader',
        use: [
          {
            loader: cssLoader,
            options: cssLoaderGlobalOptions,
          },
github xing / hops / packages / build-config / sections / module-rules / babel.js View on Github external
targets: targets,
          },
        ],
        'react',
      ],
      plugins: [].concat(plugins, [
        require.resolve('babel-plugin-transform-class-properties'),
        require.resolve('babel-plugin-transform-object-rest-spread'),
      ]),
    },
    include: require('../../lib/check-esnext'),
  };
}

exports.develop = getBabelLoader(
  { browsers: hopsConfig.browsers },
  require.resolve('babel-plugin-syntax-dynamic-import')
);

exports.build = getBabelLoader({ browsers: hopsConfig.browsers }, [
  require.resolve('babel-plugin-syntax-dynamic-import'),
  require.resolve('babel-plugin-transform-react-remove-prop-types'),
]);

exports.node = getBabelLoader(
  { node: hopsConfig.node },
  require.resolve('babel-plugin-dynamic-import-node')
);
github xing / hops / packages / build-config / sections / module-rules / babel.js View on Github external
],
      plugins: [].concat(plugins, [
        require.resolve('babel-plugin-transform-class-properties'),
        require.resolve('babel-plugin-transform-object-rest-spread'),
      ]),
    },
    include: require('../../lib/check-esnext'),
  };
}

exports.develop = getBabelLoader(
  { browsers: hopsConfig.browsers },
  require.resolve('babel-plugin-syntax-dynamic-import')
);

exports.build = getBabelLoader({ browsers: hopsConfig.browsers }, [
  require.resolve('babel-plugin-syntax-dynamic-import'),
  require.resolve('babel-plugin-transform-react-remove-prop-types'),
]);

exports.node = getBabelLoader(
  { node: hopsConfig.node },
  require.resolve('babel-plugin-dynamic-import-node')
);