Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
}
// Fix keyframes being minified to colliding names when using lazy-loaded CSS chunks
const optimizeCss = config.optimization && (config.optimization.minimizer || []).filter(plugin => /^OptimizeCssAssets(Webpack)?Plugin$/.test(plugin.constructor.name))[0];
if (optimizeCss) {
optimizeCss.options.cssProcessorOptions.reduceIdents = false;
}
Object.assign(config.optimization.splitChunks || (config.optimization.splitChunks = {}), {
minSize: 1000
});
const sizePlugin = helpers.getPluginsByName(config, 'SizePlugin')[0];
if (sizePlugin) {
config.plugins[sizePlugin.index] = new SizePlugin({
publish: true,
filename: `size-plugin-${env.ssr?'ssr':'browser'}.json`
});
}
if (!env.ssr) {
// Find YAML FrontMatter preceeding a markdown document
const FRONT_MATTER_REG = /^\s*---\n\s*([\s\S]*?)\s*\n---\n/i;
// Find a leading title in a markdown document
const TITLE_REG = /^\s*#\s+(.+)\n+/;
// Converts YAML FrontMatter to JSON FrontMatter for easy client-side parsing.
config.plugins.push(new CopyPlugin([{
context: __dirname,
from: 'content',
to: 'content',