diff --git a/webpack.config.js b/webpack.config.js index 0e1ce066064..914689eec82 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -36,14 +36,12 @@ Object.assign(webpackConfig.output, { webpackConfig.optimization.chunkIds = 'named' webpackConfig.optimization.splitChunks.cacheGroups = { - defaultVendors: { - test(module) { - return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}`) && - !module.resource.includes(`${path.sep}highlight.js${path.sep}`) - }, - name: 'vendors', - } + mermaid: { + test: /[\\/]node_modules[\\/](mermaid)[\\/]/, + name: 'mermaid', + }, } +webpackConfig.optimization.splitChunks.minSize = 102400 // Fix Buffer issues webpackConfig.plugins.push(new webpack.ProvidePlugin({ @@ -62,15 +60,4 @@ webpackRules.RULE_RAW_SVGS = { webpackConfig.module.rules = Object.values(webpackRules) -webpackConfig.optimization.splitChunks.minSize = 102400 - -webpackConfig.optimization.splitChunks.cacheGroups = { - mermaid: { - test(module) { - return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}mermaid`) - }, - name: 'mermaid', - }, -} - module.exports = webpackConfig