@autobest-ui/scripts 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -233,6 +233,17 @@ module.exports = (appConfig, extendEnv, { isProd, isServer, isHotServer }) => {
233
233
  })
234
234
  ]
235
235
  };
236
+
237
+ if (isProd) {
238
+ // build下, 忽略locale moment, 缩小代码体积
239
+ result.plugins.push(
240
+ new webpack.IgnorePlugin({
241
+ resourceRegExp: /^\.\/locale$/,
242
+ contextRegExp: /moment$/
243
+ })
244
+ );
245
+ }
246
+
236
247
  if (isProd && !isServer) {
237
248
  result.optimization = {
238
249
  chunkIds: 'named',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/scripts",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "description": "utils for project tools",
6
6
  "bin": {
@@ -92,5 +92,5 @@
92
92
  "webpack-merge": "5.8.0",
93
93
  "webpack-node-externals": "3.0.0"
94
94
  },
95
- "gitHead": "6a50d3def5d2d02802c524f99663347f410762c0"
95
+ "gitHead": "fb75bd54150164e95c075eef437badba8dcd0728"
96
96
  }
@@ -52,8 +52,7 @@ module.exports = function (appConfig, extendEnv) {
52
52
  ],
53
53
  splitChunks: {
54
54
  chunks: 'async',
55
- // 大于3kb才会分割
56
- minSize: 3072,
55
+ minSize: 10000,
57
56
  minRemainingSize: 0,
58
57
  minChunks: 1,
59
58
  // 按需加载时的最大并行请求数。
@@ -65,6 +64,7 @@ module.exports = function (appConfig, extendEnv) {
65
64
  defaultVendors: {
66
65
  test: /[\\/]node_modules[\\/]/,
67
66
  minChunks: 2,
67
+ name: 'vendor',
68
68
  priority: -10,
69
69
  reuseExistingChunk: true
70
70
  },