How to use the customize-cra.addBabelPlugins 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 ghondar / crassa / config-overrides.js View on Github external
})

const addLoadablePlugin =  config => {
  config.plugins.push(
    new LoadablePlugin()
  )

  config.plugins[0].options.inject = false

  return config
}

module.exports = override(
  process.env.NODE_ENV === 'production' && addLoadablePlugin,
  disableEsLint(),
  ...addBabelPlugins('transform-imports', '@loadable/babel-plugin', 'transform-react-remove-prop-types'),
  addWebpackAlias({ ...aliases, 'lodash-es': 'lodash' }),
  hasCustomConfigOverrides && require(appConfigOverrides)
)
github react-native-elements / react-native-elements-app / config-overrides.js View on Github external
}),
  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"),
  ]),
  addBabelPlugins(
    "@babel/plugin-proposal-class-properties",
  ),
  addWebpackAlias({
    "react-native-gesture-handler": "react-native-gesture-handler-web",
  })
);
github kitze / JSUI / config-overrides.js View on Github external
module.exports = (config, env) => {
  config = override(
    enableEslintIgnore(),
    ...addBabelPlugins(
      'babel-plugin-emotion',
      'babel-plugin-preval',
      'babel-plugin-transform-do-expressions'
    ),
    addDecoratorsLegacy(),
    babelInclude([resolveApp('src')])
  )(config);

  config.target = 'electron-renderer';
  config = rewireReactHotLoader(config, env);
  return config;
};
github hyanmandian / react-etalpreliob / config-overrides.js View on Github external
const path = require("path");
const {
  override,
  addWebpackAlias,
  addBabelPlugins,
  addBundleVisualizer
} = require("customize-cra");

module.exports = {
  webpack: override(
    addWebpackAlias({
      "#": path.resolve(__dirname, "./src"),
      "react-dom": "@hot-loader/react-dom"
    }),
    addBundleVisualizer({}, true),
    ...addBabelPlugins("emotion", "react-hot-loader/babel")
  ),
  jest: config => ({
    ...config,
    setupFilesAfterEnv: ["/.jest/setup.js"],
    moduleNameMapper: { "#(.*)$": "/src/$1" },
    coverageDirectory: "/.coverage"
  })
};
github davesnx / learn-ramda / config-overrides.js View on Github external
const { override, addBabelPlugins } = require('customize-cra')

module.exports = override(...addBabelPlugins('ramda'))
github chenxiaolei / ZLMediaKit_NVR_UI / config-overrides.js View on Github external
useEslintRc(),
    addLessLoader({
        javascriptEnabled: true,
        modifyVars: {
            '@primary-color': "#4777e8",
            '@link-color': '#4777e8',
        },

    }),

    addWebpackResolve({
        alias: {'@': path.resolve(__dirname, 'src')}
    }),


    addBabelPlugins(
        "@babel/plugin-syntax-object-rest-spread",
        ['@babel/plugin-proposal-decorators', {'legacy': true}]
    ),
    addBabelPresets([
        '@emotion/babel-preset-css-prop'
    ]),

    fixBabelImports('antd', {
        libraryName: 'antd',
        libraryDirectory: 'es',
        style: true,
    }),


);