Skip to content

Commit

Permalink
chore(deps): update dependency kkt to v7.
Browse files Browse the repository at this point in the history
Upgrade react-scripts to v5, Support Webpack 5
kktjs/kkt#198
  • Loading branch information
jaywcjlove committed Jan 10, 2022
1 parent e6292e0 commit 31f69c6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 34 deletions.
59 changes: 32 additions & 27 deletions .kktrc.ts
Expand Up @@ -19,35 +19,40 @@ export default (conf: Configuration, env: string, options: LoaderConfOptions) =>
conf.plugins!.push(new webpack.DefinePlugin({
VERSION: JSON.stringify(pkg.version),
}));
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',
},
micromark: {
test: /[\\/]node_modules[\\/](micromark)[\\/]/,
name: 'micromark-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',
},
prismjs: {
test: /[\\/]node_modules[\\/](prismjs)[\\/]/,
name: 'prismjs-vendor',
chunks: 'all',
},
micromark: {
test: /[\\/]node_modules[\\/](micromark)[\\/]/,
name: 'micromark-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;
}
12 changes: 7 additions & 5 deletions package.json
Expand Up @@ -13,7 +13,8 @@
"css:watch": "compile-less -d src -o esm --watch",
"css:build:dist": "compile-less -d src --combine dist.css --rm-global",
"watch": "tsbb watch",
"build": "tsbb build && npm run css:build && npm run css:build:dist"
"build": "tsbb build && npm run css:build && npm run css:build:dist",
"map": "source-map-explorer build/static/js/*.js --html build/website-result.html"
},
"repository": {
"type": "git",
Expand All @@ -39,15 +40,16 @@
"devDependencies": {
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"@kkt/less-modules": "6.11.0",
"@kkt/raw-modules": "6.11.0",
"@kkt/scope-plugin-options": "6.11.0",
"@kkt/less-modules": "7.0.5",
"@kkt/raw-modules": "7.0.5",
"@kkt/scope-plugin-options": "7.0.5",
"@uiw/react-github-corners": "1.5.3",
"@uiw/react-markdown-preview": "3.4.7",
"compile-less-cli": "1.8.11",
"kkt": "6.11.0",
"kkt": "7.0.5",
"react": "17.0.2",
"react-dom": "17.0.2",
"source-map-explorer": "2.5.2",
"tsbb": "3.5.4"
},
"eslintConfig": {
Expand Down
1 change: 0 additions & 1 deletion src/react-app-env.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -24,6 +24,7 @@
},
"include": [
"website",
"src/**/*"
"src",
".kktrc.ts"
]
}

0 comments on commit 31f69c6

Please sign in to comment.