How to use the customize-cra.removeModuleScopePlugin function in customize-cra

To help you get started, we’ve selected a few customize-cra 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 react-native-elements / react-native-elements-app / config-overrides.js View on Github external
const registerGlobals = vars => config => {
  if(!Array.isArray(config.plugins)) config.plugins = [];
  config.plugins.push(new webpack.DefinePlugin(vars));

  const eslintRuleOptions = config.module.rules.filter(
    r => r.use && r.use.some(u => u.options && u.options.useEslintrc !== void 0)
  )[0].use[0].options;
  if(!Array.isArray(eslintRuleOptions.globals)) eslintRuleOptions.globals = [];
  eslintRuleOptions.globals = [...eslintRuleOptions.globals, ...Object.keys(vars)];

  return config;
};

module.exports = override(
  removeModuleScopePlugin(),
  registerGlobals({
    __DEV__: (process.env.NODE_ENV === "development")
  }),
  babelInclude([
    path.resolve("src"),
    path.resolve(modulesPath, "react-native-elements"),
    path.resolve(modulesPath, "react-native-ratings"),
    path.resolve(modulesPath, "react-native-status-bar-height"),
    path.resolve(modulesPath, "react-native-vector-icons"),
    path.resolve(modulesPath, "react-native-safe-area-view"),
    path.resolve(modulesPath, "react-navigation"),
    path.resolve(modulesPath, "react-native-tab-view"),
    path.resolve(modulesPath, "react-native-touchable-scale"),
    path.resolve(modulesPath, "expo-linear-gradient"),
    path.resolve(modulesPath, "@react-navigation", "native"),
    path.resolve(modulesPath, "react-native-gesture-handler-web"),
github ian13456 / mine.js / config-overrides.js View on Github external
babelInclude,
  addWebpackAlias
} = require('customize-cra')

module.exports = override(
  (() => config => {
    config.module.rules.push({
      test: /\.worker\.js$/,
      use: { loader: 'worker-loader', options: { inline: true } }
    })

    config.output.globalObject = 'this'

    return config
  })(),
  removeModuleScopePlugin(),
  babelInclude([path.resolve(__dirname, 'src'), path.resolve(__dirname, 'core')]),
  addWebpackAlias({
    ['core']: path.resolve(__dirname, 'core')
  })
)
github nicolasgere / tawny / dist / typescript-web / example / config-overrides.js View on Github external
const { removeModuleScopePlugin } = require('customize-cra')

module.exports = removeModuleScopePlugin()