From 07ad1c1ad9246ab529478c78613fc11919ceab9b Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 14 Feb 2021 09:17:31 +0800 Subject: [PATCH] chore: Modify kkt config. #23 --- .kktrc.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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; }