Skip to content

Commit efd1ef3

Browse files
committed
chore(deps): update dependency kkt to v7.
kktjs/kkt#198 Upgrade react-scripts to v5, Support Webpack 5.x
1 parent b924c70 commit efd1ef3

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

.kktrc.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,48 @@ export default (conf: Configuration, env: 'production' | 'development', options:
1111
conf = rawModules(conf, env, { ...options });
1212
conf = scopePluginOptions(conf, env, {
1313
...options,
14-
allowedFiles: [
15-
path.resolve(process.cwd(), 'README.md')
16-
]
14+
allowedFiles: [path.resolve(process.cwd(), 'README.md')],
1715
});
1816
// Get the project version.
19-
conf.plugins!.push(new webpack.DefinePlugin({
20-
VERSION: JSON.stringify(pkg.version),
21-
}));
17+
conf.plugins!.push(
18+
new webpack.DefinePlugin({
19+
VERSION: JSON.stringify(pkg.version),
20+
}),
21+
);
2222
if (env === 'production') {
23-
conf.output = { ...conf.output, publicPath: './' }
23+
conf.output = { ...conf.output, publicPath: './' };
24+
conf.optimization = {
25+
...conf.optimization,
26+
splitChunks: {
27+
cacheGroups: {
28+
reactvendor: {
29+
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
30+
name: 'react-vendor',
31+
chunks: 'all',
32+
},
33+
prismjs: {
34+
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
35+
name: 'refractor-vendor',
36+
chunks: 'all',
37+
},
38+
uiw: {
39+
test: /[\\/]node_modules[\\/](@uiw)[\\/]/,
40+
name: 'uiw-vendor',
41+
chunks: 'all',
42+
},
43+
codemirror: {
44+
test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
45+
name: 'codemirror-vendor',
46+
chunks: 'all',
47+
},
48+
parse5: {
49+
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
50+
name: 'parse5-vendor',
51+
chunks: 'all',
52+
},
53+
},
54+
},
55+
};
2456
}
2557
return conf;
26-
}
58+
};

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
"codemirror": "5.64.0"
4646
},
4747
"devDependencies": {
48-
"@kkt/less-modules": "6.11.0",
49-
"@kkt/raw-modules": "6.11.0",
50-
"@kkt/scope-plugin-options": "6.11.0",
48+
"@kkt/less-modules": "7.0.5",
49+
"@kkt/raw-modules": "7.0.5",
50+
"@kkt/scope-plugin-options": "7.0.5",
5151
"@types/codemirror": "5.60.5",
5252
"@types/jest": "27.0.3",
5353
"@types/react": "17.0.37",
5454
"@types/react-dom": "17.0.11",
5555
"@uiw/react-github-corners": "1.5.3",
5656
"@uiw/reset.css": "1.0.5",
5757
"compile-less-cli": "1.8.9",
58-
"kkt": "6.11.0",
58+
"kkt": "7.0.5",
5959
"prettier": "2.5.0",
6060
"pretty-quick": "3.1.2",
6161
"react": "17.0.2",

0 commit comments

Comments
 (0)