@dcloudio/vue-cli-plugin-uni 2.0.2-alpha-4050720250320002 → 2.0.2-alpha-4060120250403001
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/error-reporting.js +3 -3
- package/lib/mp/index.js +22 -1
- package/lib/options.js +18 -7
- package/package.json +3 -3
package/lib/error-reporting.js
CHANGED
|
@@ -146,7 +146,7 @@ Object.assign(ErrorReport.prototype, {
|
|
|
146
146
|
})
|
|
147
147
|
|
|
148
148
|
function report (type, err) {
|
|
149
|
-
ErrorReport.instance.report(type, err)
|
|
149
|
+
// ErrorReport.instance.report(type, err)
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
global.__error_reporting__ = report
|
|
@@ -154,9 +154,9 @@ global.__error_reporting__ = report
|
|
|
154
154
|
process
|
|
155
155
|
.on('unhandledRejection', (reason, p) => {
|
|
156
156
|
console.log(reason)
|
|
157
|
-
global.__error_reporting__ && global.__error_reporting__('unhandledRejection', reason)
|
|
157
|
+
// global.__error_reporting__ && global.__error_reporting__('unhandledRejection', reason)
|
|
158
158
|
})
|
|
159
159
|
.on('uncaughtException', err => {
|
|
160
160
|
console.log(err)
|
|
161
|
-
global.__error_reporting__ && global.__error_reporting__('uncaughtException', err.stack)
|
|
161
|
+
// global.__error_reporting__ && global.__error_reporting__('uncaughtException', err.stack)
|
|
162
162
|
})
|
package/lib/mp/index.js
CHANGED
|
@@ -314,8 +314,29 @@ ${globalEnv}.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;`
|
|
|
314
314
|
|
|
315
315
|
webpackConfig.plugin('extract-css')
|
|
316
316
|
.init((Plugin, args) => new Plugin({
|
|
317
|
-
filename: '[name]' + styleExt
|
|
317
|
+
filename: '[name]' + styleExt,
|
|
318
|
+
// mini-css-extract-plugin 2.3.0 版本以上可用
|
|
319
|
+
// https://github.com/webpack-contrib/mini-css-extract-plugin/releases/tag/v2.3.0
|
|
320
|
+
runtime: false
|
|
318
321
|
}))
|
|
322
|
+
// 去除 mini-css-extract-plugin 2.3.0 以下版本的 css runtime
|
|
323
|
+
// https://github.com/webpack-contrib/mini-css-extract-plugin/blob/e200b083e5a437026d6021262d4ac56088b39e65/src/index.js#L273
|
|
324
|
+
if (require('semver').lt(require('mini-css-extract-plugin/package.json').version, '2.3.0')) {
|
|
325
|
+
const pluginName = 'skip-mini-css-extract-runtime'
|
|
326
|
+
webpackConfig.plugin(pluginName).use(
|
|
327
|
+
class SkipMiniCssExtractRuntimePlugin {
|
|
328
|
+
apply (compiler) {
|
|
329
|
+
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
330
|
+
const { mainTemplate } = compilation
|
|
331
|
+
const reg = /\/\/ mini-css-extract-plugin CSS loading[\s\S]*installedCssChunks\[chunkId\] = 0;\s*\}\)\);\s*\}/
|
|
332
|
+
mainTemplate.hooks.requireEnsure.tap(pluginName, (source, chunk) => {
|
|
333
|
+
return reg.test(source) ? source.replace(reg, '') : source
|
|
334
|
+
})
|
|
335
|
+
})
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
}
|
|
319
340
|
|
|
320
341
|
if (
|
|
321
342
|
process.env.NODE_ENV === 'production' &&
|
package/lib/options.js
CHANGED
|
@@ -16,7 +16,9 @@ module.exports = function initOptions (options) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// 增加 src/node_modules 解析
|
|
19
|
-
options.transpileDependencies.push(pathToRegexp(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules'), {
|
|
19
|
+
options.transpileDependencies.push(pathToRegexp(path.resolve(process.env.UNI_INPUT_DIR, 'node_modules'), {
|
|
20
|
+
start: true
|
|
21
|
+
}))
|
|
20
22
|
options.transpileDependencies.push('@dcloudio/uni-' + process.env.UNI_PLATFORM)
|
|
21
23
|
options.transpileDependencies.push('@dcloudio/uni-i18n')
|
|
22
24
|
options.transpileDependencies.push('@dcloudio/uni-stat')
|
|
@@ -70,11 +72,19 @@ module.exports = function initOptions (options) {
|
|
|
70
72
|
const isScss = fs.existsSync(path.resolve(process.env.UNI_INPUT_DIR, 'uni.scss'))
|
|
71
73
|
let sassData = isSass ? getPlatformSass() : getPlatformScss()
|
|
72
74
|
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
if (process.env.UNI_SASS_IMPLEMENTATION_NAME === 'dart-sass') {
|
|
76
|
+
if (isSass) {
|
|
77
|
+
sassData = '@use "@/uni.sass" as *'
|
|
78
|
+
} else if (isScss) {
|
|
79
|
+
sassData = '@use "@/uni.scss" as *;'
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
if (isSass) {
|
|
83
|
+
sassData = '@import "@/uni.sass"'
|
|
84
|
+
} else if (isScss) {
|
|
85
|
+
sassData = `${sassData}
|
|
86
|
+
@import "@/uni.scss";`
|
|
87
|
+
}
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
if (!options.css.loaderOptions.sass.sassOptions) {
|
|
@@ -87,7 +97,8 @@ module.exports = function initOptions (options) {
|
|
|
87
97
|
}
|
|
88
98
|
options.css.loaderOptions.sass.prependData = sassData
|
|
89
99
|
const userPostcssConfigPath = path.resolve(process.env.UNI_INPUT_DIR, 'postcss.config.js')
|
|
90
|
-
const configPath = fs.existsSync(userPostcssConfigPath) ? userPostcssConfigPath : path.resolve(process.env
|
|
100
|
+
const configPath = fs.existsSync(userPostcssConfigPath) ? userPostcssConfigPath : path.resolve(process.env
|
|
101
|
+
.UNI_CLI_CONTEXT, 'postcss.config.js')
|
|
91
102
|
if (webpack.version[0] > 4) {
|
|
92
103
|
options.css.loaderOptions.postcss.postcssOptions.config = configPath
|
|
93
104
|
} else {
|
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-4060120250403001",
|
|
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-4060120250403001",
|
|
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": "03545ed6acdeb0ff7d47ef9df0499f4a4180cf8c"
|
|
45
45
|
}
|