How to use the react-app-rewired.injectBabelPlugin function in react-app-rewired

To help you get started, we’ve selected a few react-app-rewired 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 svenberglund / react-mst-grid-layout / config-overrides.js View on Github external
module.exports = function override(config, env) {
  config = injectBabelPlugin("babel-plugin-styled-components", config);
  config = rewireMobX(config, env);
  
  config.module.rules.push({
    test: /\.worker\.jsx$/,
    use: [
      { loader: 'worker-loader' },
      { loader: 'babel-loader' }
    ]
  })
  /*
  // If we want to apply the babel loader to some node module...
  config = rewireBabelLoader.include(
    config,
    resolveApp("node_modules/")
  );
  */
github andriijas / monkey-admin / config-overrides.js View on Github external
module.exports = function override(config, env) {
  config = injectBabelPlugin(
    ["import", { libraryName: "antd", style: true, libraryDirectory: "es" }],
    config,
  );

  if (env === "production") {
    // Remove default polyfills
    config.entry = { main: paths.appIndexJs };

    // Change css module class names in production
    const cssLoader = getLoader(
      config.module.rules,
      rule => String(rule.test) === String(/\.module\.css$/),
    ).loader.find(loader => loaderNameMatches(loader, "css-loader"));
    cssLoader.options.localIdentName = "ma-[hash:base64:8]";

    // Include bundle analyzation
github LANIF-UI / dva-boot-desktop / config-overrides.js View on Github external
if (env === 'development') {
    config = injectBabelPlugin(['dva-hmr'], config);
  } else {
    // 替换uglify为uglify-es否则,build时会出错
    config = removeWebpackPlugins(config, env, {
      pluginNames: ['UglifyJsPlugin']
    });
    config.plugins = (config.plugins || []).concat([
      new ParallelUglifyPlugin({
        uglifyES: {}
      })
    ]);
  }

  config = injectBabelPlugin('transform-decorators-legacy', config);
  config = injectBabelPlugin(
    ['import', { libraryName: 'antd', style: true }],
    config
  );

  config.externals = {};

  return rewireLess.withLoaderOptions(
    `${env === 'production' ? 'app' : '[local]'}-[hash:base64:8]`,
    {
      modifyVars: {}
    }
  )(config, env);
};
github alibaba / nopage / examples / config-overrides.js View on Github external
module.exports = function override(config, env) {
    // do stuff with the webpack config...
    config.output.publicPath = './';
    config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config);
    config = injectBabelPlugin(['wrapper', {}], config);
    config = rewireLess.withLoaderOptions({
        modifyVars: { '@primary-color': '#1DA57A' },
        javascriptEnabled: true,
    })(config, env);

    return config;
};
github linonetwo / ipfs-browser-gateway / config-overrides.js View on Github external
module.exports = function override(config, env) {
  config = injectBabelPlugin(
    [
      'flow-runtime',
      {
        assert: true,
        annotate: true,
      },
    ],
    config,
  );

  if (env === 'production') {
    console.log('⚡ Production build with optimization ⚡');
    config = injectBabelPlugin('closure-elimination', config);
    config = injectBabelPlugin('transform-react-inline-elements', config);
    config = injectBabelPlugin('transform-react-constant-elements', config);
  }
github timarney / react-app-rewired / packages / react-app-rewire-mobx / index.js View on Github external
function rewireMobX(config, env) {
  return injectBabelPlugin('transform-decorators-legacy', config);
}
github Dasdaq / Dasdaq-web / config-overrides.js View on Github external
module.exports = function override(config, env) {
    config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config);
    config = rewireLess.withLoaderOptions({
        javascriptEnabled: true,
        modifyVars: { "@primary-color": "#FFA940" },
    })(config, env);
    return config;
};
github luffyZh / express-react-scaffold / config-overrides.js View on Github external
module.exports = function override(config, env) {
  config = injectBabelPlugin(
    ['import', { libraryName: 'antd', style: true }],
    config
  );
  config = rewireCssModules(config, env);
  config = rewireLess.withLoaderOptions({
    modifyVars: {
      '@primary-color': '#00BFFF',
      '@input-height-base': '40px',
      '@btn-height-base': '40px'
    }
  })(config, env);
  return config;
};
github wapznw / aria2desktop / config-overrides.js View on Github external
module.exports = function override(config, env) {
  config = injectBabelPlugin(['import', {libraryName: 'antd', libraryDirectory: 'es', style: 'css'}], config);
  if ('production' === env) config.devtool = 'none';
  return config;
};
github getheimdall / heimdall / frontend / config-overrides.js View on Github external
module.exports = function override(config, env) {
    config = injectBabelPlugin(['import', { libraryName: 'antd', style: true }], config)
    config = rewireLess.withLoaderOptions({
        modifyVars: themeVariables
    })(config, env)
    return config
}