Skip to content

Commit 8e69ff3

Browse files
committedJan 4, 2022
chore(deps): update dependency kkt to v7.
Upgrade react-scripts to v5, Support Webpack 5.x kktjs/kkt#198
1 parent 5df04b4 commit 8e69ff3

File tree

7 files changed

+45
-36
lines changed

7 files changed

+45
-36
lines changed
 

‎.kktrc.ts

+22-9
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';
@@ -21,15 +20,29 @@ export default (conf: Configuration, env: 'development' | 'production', options:
2120
}),
2221
);
2322
if (env === 'production') {
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+
refractor: {
33+
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
34+
name: 'refractor-vendor',
35+
chunks: 'all',
36+
},
37+
codeexample: {
38+
test: /[\\/]node_modules[\\/](code-example)[\\/]/,
39+
name: 'code-example-vendor',
40+
chunks: 'async',
41+
},
42+
},
43+
},
44+
};
2445
conf.output = { ...conf.output, publicPath: './' };
2546
}
2647
return conf;
2748
};
28-
29-
/**
30-
* Modify WebpackDevServer Configuration Example
31-
*/
32-
export const devServer = (config: WebpackDevServer.Configuration) => {
33-
// Return your customised Webpack Development Server config.
34-
return config;
35-
};

‎package.json

+12-14
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,25 @@
7979
"rehype": "12.0.0"
8080
},
8181
"devDependencies": {
82-
"@kkt/less-modules": "6.11.0",
83-
"@kkt/raw-modules": "6.11.0",
84-
"@kkt/scope-plugin-options": "6.11.0",
85-
"@testing-library/react": "12.1.2",
86-
"@types/react": "17.0.27",
87-
"@types/react-dom": "17.0.9",
82+
"@kkt/less-modules": "7.0.4",
83+
"@kkt/raw-modules": "7.0.4",
84+
"@kkt/scope-plugin-options": "7.0.4",
85+
"@types/react": "17.0.38",
86+
"@types/react-dom": "17.0.11",
8887
"@types/react-test-renderer": "17.0.1",
89-
"@types/testing-library__jest-dom": "5.14.1",
9088
"@uiw/react-github-corners": "1.5.3",
91-
"@uiw/react-markdown-preview": "3.4.2",
89+
"@uiw/react-markdown-preview": "3.4.6",
9290
"@uiw/react-loader": "4.9.7",
9391
"code-example": "3.3.1",
94-
"compile-less-cli": "1.8.9",
95-
"husky": "7.0.2",
96-
"kkt": "6.11.0",
97-
"lint-staged": "11.2.0",
98-
"prettier": "2.4.1",
92+
"compile-less-cli": "1.8.11",
93+
"husky": "7.0.4",
94+
"kkt": "7.0.4",
95+
"lint-staged": "12.1.5",
96+
"prettier": "2.5.1",
9997
"react": "17.0.2",
10098
"react-dom": "17.0.2",
10199
"react-test-renderer": "17.0.2",
102-
"tsbb": "3.4.1"
100+
"tsbb" :"3.5.4"
103101
},
104102
"eslintConfig": {
105103
"extends": [

‎react-app-env.d.ts

-11
This file was deleted.

‎src/react-app-env.d.ts

-1
This file was deleted.

‎src/shortcuts.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { stopPropagation } from './utils';
23
import { SelectionText } from './SelectionText';
34

‎src/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"extends": "../tsconfig",
3-
"include": ["../src"],
43
"compilerOptions": {
54
"baseUrl": ".",
65
"outDir": "../cjs",

‎website/react-app-env.d.ts

+10
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
/// <reference types="react-scripts" />
2+
3+
declare module '*.module.less' {
4+
const classes: { readonly [key: string]: string };
5+
export default classes;
6+
}
7+
8+
declare module '*.md' {
9+
const src: string;
10+
export default src;
11+
}

0 commit comments

Comments
 (0)
Please sign in to comment.