Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const path = require('path')
// const AntDesignThemePlugin = require('antd-theme-webpack-plugin')
const {
override,
addDecoratorsLegacy,
addBundleVisualizer,
addBabelPlugin,
addWebpackAlias,
addWebpackPlugin,
disableEsLint
} = require('customize-cra')
module.exports = override(
addDecoratorsLegacy(),
disableEsLint(),
// eslint-disable-next-line
process.env.BUNDLE_VISUALIZE == 1 && addBundleVisualizer(),
/*
// auto-imports for antd; currently we're opting for more manual control in src/lib/antd.js
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
// '@primary-color': '#d23d67'
}
}),
const { addDecoratorsLegacy, disableEsLint, override } = require('customize-cra')
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin')
const disableModuleScopePlugin = () => config => {
config.resolve.plugins = config.resolve.plugins.filter(plugin => !(plugin instanceof ModuleScopePlugin))
return config
}
module.exports = override(addDecoratorsLegacy(), disableEsLint(), disableModuleScopePlugin())
const {
override,
addDecoratorsLegacy,
disableEsLint,
addBundleVisualizer,
addWebpackAlias,
adjustWorkbox,
addLessLoader,
fixBabelImports
} = require('customize-cra');
const path = require('path');
module.exports = override(
addDecoratorsLegacy(),
disableEsLint(),
addBundleVisualizer({}, true),
addWebpackAlias({
'@': path.resolve(__dirname, 'src'),
components: path.resolve(__dirname, 'src/components'),
assets: path.resolve(__dirname, 'src/assets')
}),
adjustWorkbox(wb =>
Object.assign(wb, {
skipWaiting: true,
exclude: (wb.exclude || []).concat('index.html')
})
),
fixBabelImports('import', {
libraryName: 'antd',
style: true
const {
override,
addDecoratorsLegacy,
disableEsLint,
addBundleVisualizer,
addWebpackAlias,
adjustWorkbox,
addLessLoader,
fixBabelImports
} = require('customize-cra');
const path = require('path');
module.exports = override(
addDecoratorsLegacy(),
disableEsLint(),
process.env.BUNDLE_VISUALIZE === 1 && addBundleVisualizer(),
addWebpackAlias({
'@': path.resolve(__dirname, 'src'),
components: path.resolve(__dirname, 'src/components'),
assets: path.resolve(__dirname, 'src/assets')
}),
adjustWorkbox(wb =>
Object.assign(wb, {
skipWaiting: true,
exclude: (wb.exclude || []).concat('index.html')
})
),
fixBabelImports('import', {
libraryName: 'antd',
style: true
const { override, addDecoratorsLegacy } = require("customize-cra");
module.exports = override(addDecoratorsLegacy());
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;
};
'@gray-2': '#fafafa',
'@gray-3': '#f5f5f5',
'@gray-4': '#f0f0f0',
'@gray-5': '#d9d9d9',
'@gray-6': '#bfbfbf',
'@gray-7': '#8c8c8c',
'@gray-8': '#595959',
'@gray-9': '#262626',
'@gray-10': '#000',
},
modules: {
localIdentName: '[local]--[hash:base64:5]',
},
}),
addAlias(),
addDecoratorsLegacy(),
enableEslintIgnore(),
addYaml,
addWebpackBundleSize(),
addWebpackPlugin(new WebpackBar()),
addWebpackPlugin(
new webpack.NormalModuleReplacementPlugin(
/antd\/es\/style\/index\.less/,
path.resolve(__dirname, 'lib/antd.less')
)
),
disableMinimizeByEnv(),
addExtraEntries(),
buildAsLibrary(),
supportDynamicPublicPathPrefix()
)
const {
addDecoratorsLegacy,
disableEsLint,
override
} = require("customize-cra");
module.exports = override(
addDecoratorsLegacy(),
disableEsLint()
);
'@store': path.resolve(__dirname, 'src/store'),
'@containers': path.resolve(__dirname, 'src/containers'),
'@services': path.resolve(__dirname, 'src/services')
}),
useBabelRc(),
fixBabelImports('import', {
libraryName: 'antd-mobile',
libraryDirectory: 'lib',
style: true,
legacy: true
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: theme
}),
addDecoratorsLegacy({
legacy: true
})
)
}