diff --git a/.kktrc.ts b/.kktrc.ts index 159b8c7e..699c6ede 100644 --- a/.kktrc.ts +++ b/.kktrc.ts @@ -20,6 +20,24 @@ export default (conf: Configuration, env: string, options: LoaderConfOptions) => VERSION: JSON.stringify(pkg.version), })); + conf.optimization = { + ...conf.optimization, + splitChunks: { + cacheGroups: { + reactvendor: { + test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/, + name: 'react-vendor', + chunks: 'all', + }, + prismjs: { + test: /[\\/]node_modules[\\/](prismjs)[\\/]/, + name: 'prismjs-vendor', + chunks: 'async', + }, + } + } + } + return conf; }