diff --git a/.kktrc.ts b/.kktrc.ts index 952d20fc..1d64ae12 100644 --- a/.kktrc.ts +++ b/.kktrc.ts @@ -1,7 +1,6 @@ import path from 'path'; import webpack, { Configuration } from 'webpack'; import { LoaderConfOptions } from 'kkt'; -import WebpackDevServer from 'webpack-dev-server'; import lessModules from '@kkt/less-modules'; import rawModules from '@kkt/raw-modules'; import scopePluginOptions from '@kkt/scope-plugin-options'; @@ -21,15 +20,24 @@ export default (conf: Configuration, env: 'development' | 'production', options: }), ); if (env === 'production') { + conf.optimization = { + ...conf.optimization, + splitChunks: { + cacheGroups: { + reactvendor: { + test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/, + name: 'react-vendor', + chunks: 'all', + }, + prismjs: { + test: /[\\/]node_modules[\\/](refractor)[\\/]/, + name: 'refractor-vendor', + chunks: 'all', + }, + }, + }, + }; conf.output = { ...conf.output, publicPath: './' }; } return conf; }; - -/** - * Modify WebpackDevServer Configuration Example - */ -export const devServer = (config: WebpackDevServer.Configuration) => { - // Return your customised Webpack Development Server config. - return config; -}; diff --git a/package.json b/package.json index 08ecb7d4..2f03383b 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,9 @@ "react-dom": ">=16.9.0" }, "devDependencies": { - "@kkt/less-modules": "6.11.0", - "@kkt/raw-modules": "6.11.0", - "@kkt/scope-plugin-options": "6.11.0", + "@kkt/less-modules": "7.0.4", + "@kkt/raw-modules": "7.0.4", + "@kkt/scope-plugin-options": "7.0.4", "@types/react": "17.0.38", "@types/react-dom": "17.0.11", "@types/react-test-renderer": "17.0.1", @@ -60,14 +60,14 @@ "@uiw/react-split": "5.8.4", "@uiw/react-textarea-code-editor": "1.4.14", "husky": "7.0.4", - "kkt": "6.11.0", + "kkt": "7.0.4", "lint-staged": "12.1.5", "prettier": "2.5.1", "react": "17.0.2", "react-dom": "17.0.2", "react-router-dom": "6.2.1", "react-test-renderer": "17.0.2", - "tsbb": "3.4.4" + "tsbb": "3.5.4" }, "eslintConfig": { "extends": [