diff --git a/.kktrc.ts b/.kktrc.ts index d75c1cb9..5b587035 100644 --- a/.kktrc.ts +++ b/.kktrc.ts @@ -13,31 +13,45 @@ export default (conf: Configuration, env: 'production' | 'development', options: }), ); - conf.optimization = { - ...conf.optimization, - splitChunks: { - cacheGroups: { - reactvendor: { - test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/, - name: 'react-vendor', - chunks: 'all', - }, - katex: { - test: /[\\/]node_modules[\\/](katex)[\\/]/, - name: 'katex-vendor', - chunks: 'all', - }, - prismjs: { - test: /[\\/]node_modules[\\/](prismjs)[\\/]/, - name: 'prismjs-vendor', - chunks: 'async', - }, - }, - }, - }; - if (env === 'production') { conf.output = { ...conf.output, publicPath: './' }; + conf.optimization = { + ...conf.optimization, + splitChunks: { + cacheGroups: { + reactvendor: { + test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/, + name: 'react-vendor', + chunks: 'all', + }, + katex: { + test: /[\\/]node_modules[\\/](katex)[\\/]/, + name: 'katex-vendor', + chunks: 'all', + }, + prismjs: { + test: /[\\/]node_modules[\\/](refractor)[\\/]/, + name: 'refractor-vendor', + chunks: 'all', + }, + codemirror: { + test: /[\\/]node_modules[\\/](@codemirror)[\\/]/, + name: 'codemirror-vendor', + chunks: 'all', + }, + uiw: { + test: /[\\/]node_modules[\\/](@uiw)[\\/]/, + name: 'uiw-vendor', + chunks: 'all', + }, + parse5: { + test: /[\\/]node_modules[\\/](parse5)[\\/]/, + name: 'parse5-vendor', + chunks: 'all', + }, + }, + }, + }; } return conf; }; diff --git a/package.json b/package.json index e83d96fc..3ba1fb06 100644 --- a/package.json +++ b/package.json @@ -45,15 +45,14 @@ "*.{js,jsx,tsx,ts,less,md,json}": "prettier --write" }, "devDependencies": { - "@kkt/less-modules": "6.11.0", + "@kkt/less-modules": "7.0.5", "@types/react": "17.0.38", "@types/react-dom": "17.0.11", "@types/react-redux": "7.1.21", - "@types/react-router-dom": "5.3.2", "husky": "7.0.4", "lint-staged": "11.2.6", "prettier": "2.5.1", - "kkt": "6.11.0" + "kkt": "7.0.5" }, "eslintConfig": { "extends": [