Skip to content

Commit 8ff72d7

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

File tree

3 files changed

+41
-22
lines changed

3 files changed

+41
-22
lines changed

.kktrc.ts

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from 'path';
22
import webpack, { Configuration } from 'webpack';
33
import { LoaderConfOptions } from 'kkt';
4-
import WebpackDevServer from 'webpack-dev-server';
54
import lessModules from '@kkt/less-modules';
65
import rawModules from '@kkt/raw-modules';
76
import scopePluginOptions from '@kkt/scope-plugin-options';
@@ -20,14 +19,35 @@ export default (conf: Configuration, env: 'development' | 'production', options:
2019
VERSION: JSON.stringify(pkg.version),
2120
}),
2221
);
23-
conf.output = { ...conf.output, publicPath: './' };
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+
refractor: {
34+
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
35+
name: 'refractor-prismjs-vendor',
36+
chunks: 'all',
37+
},
38+
runtime: {
39+
test: /[\\/]node_modules[\\/](@babel)[\\/]/,
40+
name: 'babel-vendor',
41+
chunks: 'all',
42+
},
43+
parse5: {
44+
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
45+
name: 'parse5-vendor',
46+
chunks: 'all',
47+
},
48+
}
49+
}
50+
}
51+
}
2452
return conf;
2553
};
26-
27-
/**
28-
* Modify WebpackDevServer Configuration Example
29-
*/
30-
export const devServer = (config: WebpackDevServer.Configuration) => {
31-
// Return your customised Webpack Development Server config.
32-
return config;
33-
};

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,22 @@
3636
"react-dom": ">=16.9.0"
3737
},
3838
"devDependencies": {
39-
"@kkt/less-modules": "6.11.0",
40-
"@kkt/raw-modules": "6.11.0",
41-
"@kkt/scope-plugin-options": "6.11.0",
42-
"@types/react": "17.0.20",
43-
"@types/react-dom": "17.0.9",
39+
"@kkt/less-modules": "7.0.5",
40+
"@kkt/raw-modules": "7.0.5",
41+
"@kkt/scope-plugin-options": "7.0.5",
42+
"@types/react": "17.0.38",
43+
"@types/react-dom": "17.0.11",
4444
"@types/react-test-renderer": "17.0.1",
4545
"@uiw/react-github-corners": "1.5.3",
46-
"@uiw/react-markdown-preview": "3.3.2",
47-
"husky": "7.0.2",
48-
"kkt": "6.11.0",
49-
"lint-staged": "11.1.2",
50-
"prettier": "2.4.0",
46+
"@uiw/react-markdown-preview": "3.4.7",
47+
"husky": "7.0.4",
48+
"kkt": "7.0.5",
49+
"lint-staged": "12.1.7",
50+
"prettier": "2.5.1",
5151
"react": "17.0.2",
5252
"react-dom": "17.0.2",
5353
"react-test-renderer": "17.0.2",
54-
"tsbb": "3.1.5"
54+
"tsbb": "3.5.4"
5555
},
5656
"eslintConfig": {
5757
"extends": [

src/react-app-env.d.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)