@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-36720221017003 → 2.0.1-alpha-36720221018002
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/configure-webpack.js +24 -9
- package/lib/env.js +24 -3
- package/package.json +3 -3
package/lib/configure-webpack.js
CHANGED
|
@@ -106,7 +106,6 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
106
106
|
const tsLoaderOptions = {
|
|
107
107
|
context,
|
|
108
108
|
configFile: tsConfigJsonFile,
|
|
109
|
-
transpileOnly: false,
|
|
110
109
|
compilerOptions: {
|
|
111
110
|
baseUrl: context,
|
|
112
111
|
typeRoots: [resolveModule('@dcloudio/types'), resolveModule('@types')],
|
|
@@ -135,6 +134,12 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
135
134
|
],
|
|
136
135
|
'mpvue-page-factory': [
|
|
137
136
|
resolveModule('@dcloudio/vue-cli-plugin-uni/packages/mpvue-page-factory')
|
|
137
|
+
],
|
|
138
|
+
'@vue/composition-api': [
|
|
139
|
+
resolveModule('@dcloudio/vue-cli-plugin-uni/packages/@vue/composition-api')
|
|
140
|
+
],
|
|
141
|
+
'@dcloudio/uni-app': [
|
|
142
|
+
resolveModule('@dcloudio/uni-app')
|
|
138
143
|
]
|
|
139
144
|
}
|
|
140
145
|
},
|
|
@@ -155,7 +160,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
155
160
|
function updateTsLoader (rawRules, fakeFile, loader) {
|
|
156
161
|
const matchRule = rawRules.find(createMatcher(fakeFile))
|
|
157
162
|
if (matchRule && matchRule.use) {
|
|
158
|
-
if (
|
|
163
|
+
if (isInHBuilderX) {
|
|
159
164
|
matchRule.use.forEach(matchUse => {
|
|
160
165
|
if (matchUse.loader.includes('ts-loader')) {
|
|
161
166
|
Object.assign(matchUse.options, tsLoaderOptions)
|
|
@@ -230,10 +235,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
230
235
|
webpackConfig.resolve.modules = webpackConfig.resolve.modules.filter(module => module !== 'node_modules')
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
const plugins = [
|
|
234
|
-
new webpack.ProvidePlugin(require('@dcloudio/uni-cli-shared/lib/uni_modules/uni_modules')
|
|
235
|
-
.parseUniExtApis())
|
|
236
|
-
]
|
|
238
|
+
const plugins = []
|
|
237
239
|
|
|
238
240
|
const isAppView = process.env.UNI_PLATFORM === 'app-plus' &&
|
|
239
241
|
vueOptions.pluginOptions &&
|
|
@@ -245,6 +247,19 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
245
247
|
plugins.push(new CopyWebpackPlugin(CopyWebpackPluginVersion > 5 ? {
|
|
246
248
|
patterns
|
|
247
249
|
} : patterns))
|
|
250
|
+
|
|
251
|
+
const uniExtApis = require('@dcloudio/uni-cli-shared/lib/uni_modules/uni_modules')
|
|
252
|
+
.parseUniExtApis(false)
|
|
253
|
+
const keys = Object.keys(uniExtApis)
|
|
254
|
+
if (keys.length) {
|
|
255
|
+
if (process.env.UNI_PLATFORM === 'app-plus') {
|
|
256
|
+
keys.forEach(key => {
|
|
257
|
+
console.warn(`[${uniExtApis[key][0].split('/')[2]}]: uts目前仅支持vue3`)
|
|
258
|
+
})
|
|
259
|
+
} else {
|
|
260
|
+
plugins.push(new webpack.ProvidePlugin(uniExtApis))
|
|
261
|
+
}
|
|
262
|
+
}
|
|
248
263
|
}
|
|
249
264
|
if (!process.env.UNI_SUBPACKGE || !process.env.UNI_MP_PLUGIN) {
|
|
250
265
|
try {
|
|
@@ -266,7 +281,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
266
281
|
plugins.push(new CopyWebpackPlugin(CopyWebpackPluginVersion > 5 ? {
|
|
267
282
|
patterns
|
|
268
283
|
} : patterns))
|
|
269
|
-
} catch (e) {}
|
|
284
|
+
} catch (e) { }
|
|
270
285
|
}
|
|
271
286
|
|
|
272
287
|
if (process.UNI_SCRIPT_ENV && Object.keys(process.UNI_SCRIPT_ENV).length) {
|
|
@@ -365,7 +380,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
365
380
|
dir: process.env.UNI_INPUT_DIR
|
|
366
381
|
}))
|
|
367
382
|
}
|
|
368
|
-
} catch (e) {}
|
|
383
|
+
} catch (e) { }
|
|
369
384
|
|
|
370
385
|
const resolveLoaderAlias = {}
|
|
371
386
|
const modules = ['@vue/cli-plugin-babel', '@vue/cli-service']
|
|
@@ -418,4 +433,4 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
418
433
|
watchOptions: require('./util').getWatchOptions()
|
|
419
434
|
}, platformWebpackConfig)
|
|
420
435
|
}
|
|
421
|
-
}
|
|
436
|
+
}
|
package/lib/env.js
CHANGED
|
@@ -148,6 +148,23 @@ if (process.env.UNI_OUTPUT_DIR && process.env.UNI_OUTPUT_DIR.indexOf('./') === 0
|
|
|
148
148
|
process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'
|
|
149
149
|
process.env.VUE_APP_PLATFORM = process.env.UNI_PLATFORM
|
|
150
150
|
process.env.UNI_OUTPUT_DIR = process.env.UNI_OUTPUT_DIR || process.env.UNI_OUTPUT_DEFAULT_DIR
|
|
151
|
+
initUtsPlatform()
|
|
152
|
+
|
|
153
|
+
function initUtsPlatform () {
|
|
154
|
+
if (process.env.UNI_APP_PLATFORM === 'android') {
|
|
155
|
+
process.env.UNI_UTS_PLATFORM = 'app-android'
|
|
156
|
+
}
|
|
157
|
+
if (process.env.UNI_APP_PLATFORM === 'ios') {
|
|
158
|
+
process.env.UNI_UTS_PLATFORM = 'app-ios'
|
|
159
|
+
}
|
|
160
|
+
if (process.env.UNI_PLATFORM === 'h5') {
|
|
161
|
+
process.env.UNI_UTS_PLATFORM = 'web'
|
|
162
|
+
} else {
|
|
163
|
+
if (!process.env.UNI_UTS_PLATFORM) {
|
|
164
|
+
process.env.UNI_UTS_PLATFORM = process.env.UNI_PLATFORM
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
151
168
|
|
|
152
169
|
if (process.env.UNI_PLATFORM === 'app-plus') {
|
|
153
170
|
process.env.UNI_OUTPUT_TMP_DIR = path.resolve(process.env.UNI_OUTPUT_DIR, '../.tmp/app-plus')
|
|
@@ -367,7 +384,9 @@ if (
|
|
|
367
384
|
} else {
|
|
368
385
|
uniStatLog(`已开启 uni统计${uniStatistics.version}.0 版本`)
|
|
369
386
|
if (version === '2') {
|
|
370
|
-
uniStatLog(
|
|
387
|
+
uniStatLog(
|
|
388
|
+
'【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
|
|
389
|
+
)
|
|
371
390
|
}
|
|
372
391
|
}
|
|
373
392
|
}
|
|
@@ -379,7 +398,9 @@ if (
|
|
|
379
398
|
} else {
|
|
380
399
|
uniStatLog(`已开启 uni统计${uniStatistics.version}.0 版本`)
|
|
381
400
|
if (version === '2') {
|
|
382
|
-
uniStatLog(
|
|
401
|
+
uniStatLog(
|
|
402
|
+
'【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
|
|
403
|
+
)
|
|
383
404
|
}
|
|
384
405
|
}
|
|
385
406
|
}
|
|
@@ -569,4 +590,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
|
|
|
569
590
|
|
|
570
591
|
module.exports = {
|
|
571
592
|
manifestPlatformOptions: platformOptions
|
|
572
|
-
}
|
|
593
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/vue-cli-plugin-uni",
|
|
3
|
-
"version": "2.0.1-alpha-
|
|
3
|
+
"version": "2.0.1-alpha-36720221018002",
|
|
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.1-alpha-
|
|
20
|
+
"@dcloudio/uni-stat": "^2.0.1-alpha-36720221018002",
|
|
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": "595dafce3471cb9a16766b6b6feaccf752481dc3"
|
|
45
45
|
}
|