@dcloudio/vue-cli-plugin-uni 2.0.2-alpha-3061420221216002 → 2.0.2-alpha-3061520221220001

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.
@@ -89,8 +89,8 @@ module.exports = function getSplitChunks () {
89
89
  }
90
90
  if (module.resource && (
91
91
  module.resource.indexOf('.vue') !== -1 ||
92
- module.resource.indexOf('.nvue') !== -1 ||
93
- normalizePath(module.resource).indexOf(mainPath) === 0 // main.js
92
+ module.resource.indexOf('.nvue') !== -1 ||
93
+ normalizePath(module.resource).indexOf(mainPath) === 0 // main.js
94
94
  )) {
95
95
  return false
96
96
  }
@@ -120,6 +120,15 @@ module.exports = function getSplitChunks () {
120
120
  }
121
121
  return true
122
122
  }
123
+
124
+ function getModuleChunks (module, chunks) {
125
+ // webpack5
126
+ if ('chunkGraph' in chunks) {
127
+ chunks = chunks.chunkGraph.getModuleChunks(module)
128
+ }
129
+ return chunks
130
+ }
131
+
123
132
  // TODO 独立分包
124
133
 
125
134
  const cacheGroups = {
@@ -130,6 +139,7 @@ module.exports = function getSplitChunks () {
130
139
  if (!baseTest(module)) {
131
140
  return false
132
141
  }
142
+ chunks = getModuleChunks(module, chunks)
133
143
  const matchSubPackages = findSubPackages(chunks)
134
144
  const matchSubPackagesCount = matchSubPackages.size
135
145
  const isMainPackage = ( // 非分包 或 两个及以上分包 或 主包内有使用
@@ -210,6 +220,7 @@ module.exports = function getSplitChunks () {
210
220
  if (!baseTest(module)) {
211
221
  return false
212
222
  }
223
+ chunks = getModuleChunks(module, chunks)
213
224
  const matchSubPackages = findSubPackages(chunks)
214
225
  if (
215
226
  matchSubPackages.size === 1 &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.2-alpha-3061420221216002",
3
+ "version": "2.0.2-alpha-3061520221220001",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.2-alpha-3061420221216002",
20
+ "@dcloudio/uni-stat": "^2.0.2-alpha-3061520221220001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "cross-env": "^5.2.0",
@@ -41,5 +41,5 @@
41
41
  "copy-webpack-plugin": ">=5",
42
42
  "postcss": ">=7"
43
43
  },
44
- "gitHead": "24aa8c66b1737ee5f995f1e6f36395c4e7a76347"
44
+ "gitHead": "029a07aae58f836f6e2d3d8e0a51d175bae5cb6d"
45
45
  }