Skip to content

Commit 8e2a964

Browse files
committed
chore: Fix starup service stuck.
Startup service stuck kktjs/kkt#330
1 parent acf638c commit 8e2a964

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.kktrc.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,26 @@ export default (conf: Configuration, env: string, options: LoaderConfOptions) =>
1919
VERSION: JSON.stringify(pkg.version),
2020
}),
2121
);
22-
23-
conf.optimization = {
24-
...conf.optimization,
25-
splitChunks: {
26-
cacheGroups: {
27-
reactvendor: {
28-
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
29-
name: 'react-vendor',
30-
chunks: 'all',
31-
},
32-
prismjs: {
33-
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
34-
name: 'refractor-vendor',
35-
chunks: 'all',
22+
if (env === 'production') {
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+
},
3638
},
3739
},
38-
},
39-
};
40+
};
41+
}
4042

4143
return conf;
4244
};

0 commit comments

Comments
 (0)