File tree Expand file tree Collapse file tree 2 files changed +19
-23
lines changed
km-console/packages/layout-clusters-fe/config Expand file tree Collapse file tree 2 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,12 @@ class CoverHtmlWebpackPlugin {
8686
8787 assetJson . reverse ( ) . forEach ( ( item ) => {
8888 if ( / \. j s $ / . test ( item ) ) {
89- // if (item.includes('vendor~')) {
90- // vendors += `<script async src="${item}"></script>`;
91- // } else {
92- // TODO: entry 只有一个
93- portalMap [ '@portal/layout' ] = item ;
94- // }
89+ if ( item . includes ( 'vendor~' ) ) {
90+ vendors += `<script async src="${ item } "></script>` ;
91+ } else {
92+ // TODO: entry 只有一个
93+ portalMap [ '@portal/layout' ] = item ;
94+ }
9595 } else if ( / \. c s s $ / . test ( item ) ) {
9696 links += `<link href="${ item } " rel="stylesheet">` ;
9797 }
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ const TerserJSPlugin = require('terser-webpack-plugin');
99const OptimizeCSSAssetsPlugin = require ( 'optimize-css-assets-webpack-plugin' ) ;
1010const theme = require ( './theme' ) ;
1111const ReactRefreshWebpackPlugin = require ( '@pmmmwh/react-refresh-webpack-plugin' ) ;
12- const HardSourceWebpackPlugin = require ( 'hard-source-webpack-plugin' ) ;
1312
1413const isProd = process . env . NODE_ENV === 'production' ;
1514const babelOptions = {
@@ -43,7 +42,6 @@ const babelOptions = {
4342module . exports = ( ) => {
4443 const cssFileName = isProd ? '[name]-[chunkhash].css' : '[name].css' ;
4544 const plugins = [
46- // !isProd && new HardSourceWebpackPlugin(),
4745 new CoverHtmlWebpackPlugin ( ) ,
4846 new ProgressBarPlugin ( ) ,
4947 new CaseSensitivePathsPlugin ( ) ,
@@ -150,23 +148,21 @@ module.exports = () => {
150148 ] ,
151149 } ,
152150 optimization : Object . assign (
153- // {
154- // splitChunks: {
155- // cacheGroups: {
156- // vendor: {
157- // test: /[\\/]node_modules[\\/]/,
158- // chunks: 'all',
159- // name: 'vendor',
160- // priority: 10,
161- // enforce: true,
162- // minChunks: 1,
163- // maxSize: 3500000,
164- // },
165- // },
166- // },
167- // },
168151 isProd
169152 ? {
153+ splitChunks : {
154+ cacheGroups : {
155+ vendor : {
156+ test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ,
157+ chunks : 'all' ,
158+ name : 'vendor' ,
159+ priority : 10 ,
160+ enforce : true ,
161+ minChunks : 1 ,
162+ maxSize : 3000000 ,
163+ } ,
164+ } ,
165+ } ,
170166 minimizer : [
171167 new TerserJSPlugin ( {
172168 cache : true ,
You can’t perform that action at this time.
0 commit comments