@dcloudio/vue-cli-plugin-uni 2.0.2-alpha-4020920240929001 → 2.0.2-alpha-4030120241010001
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.
- package/lib/app-plus/index.js +12 -5
- package/lib/env.js +22 -0
- package/lib/split-chunks.js +12 -6
- package/package.json +3 -3
- package/packages/mp-vue/dist/mp.runtime.esm.js +2 -2
package/lib/app-plus/index.js
CHANGED
|
@@ -127,6 +127,16 @@ const v3 = {
|
|
|
127
127
|
entry['app-view'] = path.resolve(process.env.UNI_INPUT_DIR, getMainEntry())
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
const plugins = [
|
|
131
|
+
new WebpackUniAppPlugin(),
|
|
132
|
+
new webpack.ProvidePlugin(getProvides(isAppService))
|
|
133
|
+
]
|
|
134
|
+
if (isAppService) {
|
|
135
|
+
const {
|
|
136
|
+
WebpackUTSPlugin
|
|
137
|
+
} = require('@dcloudio/uni-cli-shared/lib/uts/uts-webpack-plugin.js')
|
|
138
|
+
plugins.push(new WebpackUTSPlugin())
|
|
139
|
+
}
|
|
130
140
|
return {
|
|
131
141
|
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
|
132
142
|
externals: {
|
|
@@ -194,10 +204,7 @@ const v3 = {
|
|
|
194
204
|
// )
|
|
195
205
|
]
|
|
196
206
|
},
|
|
197
|
-
plugins
|
|
198
|
-
new WebpackUniAppPlugin(),
|
|
199
|
-
new webpack.ProvidePlugin(getProvides(isAppService))
|
|
200
|
-
]
|
|
207
|
+
plugins
|
|
201
208
|
}
|
|
202
209
|
},
|
|
203
210
|
chainWebpack (webpackConfig, vueOptions, api) {
|
|
@@ -285,4 +292,4 @@ if (process.env.UNI_USING_V3) {
|
|
|
285
292
|
module.exports = v3
|
|
286
293
|
} else {
|
|
287
294
|
module.exports = require('../mp')
|
|
288
|
-
}
|
|
295
|
+
}
|
package/lib/env.js
CHANGED
|
@@ -178,6 +178,28 @@ if (process.env.UNI_OUTPUT_DIR && process.env.UNI_OUTPUT_DIR.indexOf('./') === 0
|
|
|
178
178
|
process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'
|
|
179
179
|
process.env.VUE_APP_PLATFORM = process.env.UNI_PLATFORM
|
|
180
180
|
process.env.UNI_OUTPUT_DIR = process.env.UNI_OUTPUT_DIR || process.env.UNI_OUTPUT_DEFAULT_DIR
|
|
181
|
+
|
|
182
|
+
process.env.UNI_APP_X_TSC = 'true'
|
|
183
|
+
if (manifestJsonObj['app-plus']?.['utsCompilerVersion'] === 'v1') {
|
|
184
|
+
process.env.UNI_APP_X_TSC = 'false'
|
|
185
|
+
}
|
|
186
|
+
const baseOutDir = path.basename(process.env.UNI_OUTPUT_DIR)
|
|
187
|
+
process.env.UNI_APP_X_CACHE_DIR =
|
|
188
|
+
process.env.UNI_APP_X_CACHE_DIR ||
|
|
189
|
+
path.resolve(process.env.UNI_OUTPUT_DIR, '../cache/.' + baseOutDir)
|
|
190
|
+
|
|
191
|
+
process.env.UNI_APP_X_TSC_DIR = path.resolve(
|
|
192
|
+
process.env.UNI_OUTPUT_DIR,
|
|
193
|
+
'../.tsc'
|
|
194
|
+
)
|
|
195
|
+
process.env.UNI_APP_X_UVUE_DIR = path.resolve(
|
|
196
|
+
process.env.UNI_OUTPUT_DIR,
|
|
197
|
+
'../.uvue'
|
|
198
|
+
)
|
|
199
|
+
process.env.UNI_APP_X_TSC_CACHE_DIR = path.resolve(
|
|
200
|
+
process.env.UNI_APP_X_CACHE_DIR,
|
|
201
|
+
'tsc'
|
|
202
|
+
)
|
|
181
203
|
initUtsPlatform()
|
|
182
204
|
|
|
183
205
|
function initUtsPlatform () {
|
package/lib/split-chunks.js
CHANGED
|
@@ -5,9 +5,15 @@ const {
|
|
|
5
5
|
} = require('@dcloudio/uni-cli-shared')
|
|
6
6
|
|
|
7
7
|
const subPkgsInfo = Object.values(process.UNI_SUBPACKAGES)
|
|
8
|
-
const normalFilter = ({
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const normalFilter = ({
|
|
9
|
+
independent
|
|
10
|
+
}) => !independent
|
|
11
|
+
const independentFilter = ({
|
|
12
|
+
independent
|
|
13
|
+
}) => independent
|
|
14
|
+
const map2Root = ({
|
|
15
|
+
root
|
|
16
|
+
}) => root + '/'
|
|
11
17
|
const normalSubPackageRoots = subPkgsInfo.filter(normalFilter).map(map2Root)
|
|
12
18
|
const independentSubpackageRoots = subPkgsInfo.filter(independentFilter).map(map2Root)
|
|
13
19
|
|
|
@@ -77,7 +83,7 @@ module.exports = function getSplitChunks () {
|
|
|
77
83
|
if (!process.env.UNI_OPT_SUBPACKAGES) {
|
|
78
84
|
return {
|
|
79
85
|
chunks (chunk) { // 防止 node_modules 内 vue 组件被 split
|
|
80
|
-
return chunk.name.indexOf('node-modules') !== 0
|
|
86
|
+
return (chunk.name || '').indexOf('node-modules') !== 0
|
|
81
87
|
},
|
|
82
88
|
cacheGroups: {
|
|
83
89
|
default: false,
|
|
@@ -89,8 +95,8 @@ module.exports = function getSplitChunks () {
|
|
|
89
95
|
}
|
|
90
96
|
if (module.resource && (
|
|
91
97
|
module.resource.indexOf('.vue') !== -1 ||
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
module.resource.indexOf('.nvue') !== -1 ||
|
|
99
|
+
normalizePath(module.resource).indexOf(mainPath) === 0 // main.js
|
|
94
100
|
)) {
|
|
95
101
|
return false
|
|
96
102
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/vue-cli-plugin-uni",
|
|
3
|
-
"version": "2.0.2-alpha-
|
|
3
|
+
"version": "2.0.2-alpha-4030120241010001",
|
|
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-
|
|
20
|
+
"@dcloudio/uni-stat": "^2.0.2-alpha-4030120241010001",
|
|
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": "
|
|
44
|
+
"gitHead": "57a91f414fe40a29a7ff4dacc3a30612cba94e70"
|
|
45
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Vue.js v2.6.11
|
|
3
|
-
* (c) 2014-
|
|
3
|
+
* (c) 2014-2024 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
/* */
|
|
@@ -513,7 +513,7 @@ var hasProto = '__proto__' in {};
|
|
|
513
513
|
var inBrowser = typeof window !== 'undefined';
|
|
514
514
|
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
|
|
515
515
|
var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
|
|
516
|
-
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
|
516
|
+
var UA = inBrowser && window.navigator && window.navigator.userAgent.toLowerCase();
|
|
517
517
|
var isIE = UA && /msie|trident/.test(UA);
|
|
518
518
|
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
|
519
519
|
var isEdge = UA && UA.indexOf('edge/') > 0;
|