Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (pluginOptions.customizeTheme) {
Object.assign(modifyVars, pluginOptions.customizeTheme);
}
const lessLoaderOptions = pluginOptions.lessLoaderOptions || {};
if (lessLoaderOptions.modifyVars) {
Object.assign(modifyVars, lessLoaderOptions.modifyVars);
}
lessLoaderOptions.modifyVars = modifyVars;
// javascriptEnabled: true is suggested in the Ant Design docs:
// https://ant.design/docs/react/customize-theme#Customize-in-webpack
lessLoaderOptions.javascriptEnabled = true;
return CracoLessPlugin.overrideWebpackConfig({
context,
webpackConfig,
pluginOptions: {
styleLoaderOptions: pluginOptions.styleLoaderOptions || {},
cssLoaderOptions: pluginOptions.cssLoaderOptions || {},
postcssLoaderOptions: pluginOptions.postcssLoaderOptions || {},
lessLoaderOptions,
modifyLessRule: pluginOptions.modifyLessRule,
miniCssExtractPluginOptions:
pluginOptions.miniCssExtractPluginOptions || {}
}
});
};