Skip to content

Commit

Permalink
chore(deps): update dependency kkt to v7.
Browse files Browse the repository at this point in the history
Upgrade react-scripts to v5, Support Webpack 5
kktjs/kkt#198
  • Loading branch information
jaywcjlove committed Jan 10, 2022
1 parent 3edafe4 commit 8ff72d7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
40 changes: 30 additions & 10 deletions .kktrc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path';
import webpack, { Configuration } from 'webpack';
import { LoaderConfOptions } from 'kkt';
import WebpackDevServer from 'webpack-dev-server';
import lessModules from '@kkt/less-modules';
import rawModules from '@kkt/raw-modules';
import scopePluginOptions from '@kkt/scope-plugin-options';
Expand All @@ -20,14 +19,35 @@ export default (conf: Configuration, env: 'development' | 'production', options:
VERSION: JSON.stringify(pkg.version),
}),
);
conf.output = { ...conf.output, publicPath: './' };
if (env === 'production') {
conf.output = { ...conf.output, publicPath: './' };
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-prismjs-vendor',
chunks: 'all',
},
runtime: {
test: /[\\/]node_modules[\\/](@babel)[\\/]/,
name: 'babel-vendor',
chunks: 'all',
},
parse5: {
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
name: 'parse5-vendor',
chunks: 'all',
},
}
}
}
}
return conf;
};

/**
* Modify WebpackDevServer Configuration Example
*/
export const devServer = (config: WebpackDevServer.Configuration) => {
// Return your customised Webpack Development Server config.
return config;
};
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
"react-dom": ">=16.9.0"
},
"devDependencies": {
"@kkt/less-modules": "6.11.0",
"@kkt/raw-modules": "6.11.0",
"@kkt/scope-plugin-options": "6.11.0",
"@types/react": "17.0.20",
"@types/react-dom": "17.0.9",
"@kkt/less-modules": "7.0.5",
"@kkt/raw-modules": "7.0.5",
"@kkt/scope-plugin-options": "7.0.5",
"@types/react": "17.0.38",
"@types/react-dom": "17.0.11",
"@types/react-test-renderer": "17.0.1",
"@uiw/react-github-corners": "1.5.3",
"@uiw/react-markdown-preview": "3.3.2",
"husky": "7.0.2",
"kkt": "6.11.0",
"lint-staged": "11.1.2",
"prettier": "2.4.0",
"@uiw/react-markdown-preview": "3.4.7",
"husky": "7.0.4",
"kkt": "7.0.5",
"lint-staged": "12.1.7",
"prettier": "2.5.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-test-renderer": "17.0.2",
"tsbb": "3.1.5"
"tsbb": "3.5.4"
},
"eslintConfig": {
"extends": [
Expand Down
1 change: 0 additions & 1 deletion src/react-app-env.d.ts

This file was deleted.

0 comments on commit 8ff72d7

Please sign in to comment.