Skip to content

Commit 755ce91

Browse files
committed
website: Fix startup service stuck.
Startup service stuck kktjs/kkt#330 Upgrade react-scripts to v5, Support Webpack 5.x kktjs/kkt#198
1 parent 651e60a commit 755ce91

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

.kktrc.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,29 @@ export default (conf: Configuration, env: 'development' | 'production', options:
2323
VERSION: JSON.stringify(pkg.version),
2424
}),
2525
);
26-
27-
conf.optimization = {
28-
...conf.optimization,
29-
splitChunks: {
30-
cacheGroups: {
31-
reactvendor: {
32-
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
33-
name: 'react-vendor',
34-
chunks: 'all',
26+
if (env === 'production') {
27+
conf.optimization = {
28+
...conf.optimization,
29+
splitChunks: {
30+
cacheGroups: {
31+
reactvendor: {
32+
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
33+
name: 'react-vendor',
34+
chunks: 'all',
35+
},
36+
refractor: {
37+
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
38+
name: 'refractor-vendor',
39+
chunks: 'all',
40+
},
41+
codemirror: {
42+
test: /[\\/]node_modules[\\/](@codemirror)[\\/]/,
43+
name: 'codemirror-vendor',
44+
chunks: 'all',
45+
},
3546
},
36-
// prismjs: {
37-
// test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
38-
// name: 'codemirror-vendor',
39-
// chunks: 'async',
40-
// },
4147
},
42-
},
43-
};
44-
if (env === 'production') {
48+
};
4549
conf.output = { ...conf.output, publicPath: './' };
4650
}
4751
return conf;

0 commit comments

Comments
 (0)