Skip to content

Commit

Permalink
website: Fix startup service stuck.
Browse files Browse the repository at this point in the history
Startup service stuck
kktjs/kkt#330

Upgrade react-scripts to v5, Support Webpack 5.x
kktjs/kkt#198
  • Loading branch information
ienjoygit committed Jan 4, 2022
1 parent b1145a9 commit bf46346
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .kktrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,29 @@ export default (conf: Configuration, env: 'development' | 'production', options:
VERSION: JSON.stringify(pkg.version),
}),
);

conf.optimization = {
...conf.optimization,
splitChunks: {
cacheGroups: {
reactvendor: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
chunks: 'all',
if (env === 'production') {
conf.optimization = {
...conf.optimization,
splitChunks: {
cacheGroups: {
reactvendor: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
chunks: 'all',
},
refractor: {
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
name: 'refractor-vendor',
chunks: 'all',
},
codemirror: {
test: /[\\/]node_modules[\\/](@codemirror)[\\/]/,
name: 'codemirror-vendor',
chunks: 'all',
},
},
// prismjs: {
// test: /[\\/]node_modules[\\/](codemirror)[\\/]/,
// name: 'codemirror-vendor',
// chunks: 'async',
// },
},
},
};
if (env === 'production') {
};
conf.output = { ...conf.output, publicPath: './' };
}
return conf;
Expand Down

0 comments on commit bf46346

Please sign in to comment.