Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
}),
);
}