@dcloudio/vue-cli-plugin-uni 2.0.1-33420211228002 → 2.0.1-33620211231001
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 +8 -4
- package/lib/mp/index.js +11 -11
- package/package.json +3 -3
- package/packages/sass-loader/dist/index.js +0 -1
- package/packages/sass-loader/dist/options.json +4 -0
- package/packages/sass-loader/dist/webpackImporter.js +5 -4
- package/packages/webpack-uni-app-loader/view/main.js +2 -1
package/lib/configure-webpack.js
CHANGED
|
@@ -69,12 +69,14 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
69
69
|
|
|
70
70
|
const tsConfigJsonFile = fs.existsSync(userTsConfigJson) ? userTsConfigJson : defaultTsConfigJson
|
|
71
71
|
|
|
72
|
+
const context = isInHBuilderX ? process.env.UNI_INPUT_DIR : process.env.UNI_CLI_CONTEXT
|
|
73
|
+
|
|
72
74
|
const tsLoaderOptions = {
|
|
73
|
-
context
|
|
75
|
+
context,
|
|
74
76
|
configFile: tsConfigJsonFile,
|
|
75
77
|
transpileOnly: false,
|
|
76
78
|
compilerOptions: {
|
|
77
|
-
baseUrl:
|
|
79
|
+
baseUrl: context,
|
|
78
80
|
typeRoots: [resolveModule('@dcloudio/types'), resolveModule('@types')],
|
|
79
81
|
types: [
|
|
80
82
|
'uni-app',
|
|
@@ -302,7 +304,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
302
304
|
const resolveLoaderAlias = {}
|
|
303
305
|
const modules = ['@vue/cli-plugin-babel', '@vue/cli-service']
|
|
304
306
|
modules.forEach(m => {
|
|
305
|
-
const {
|
|
307
|
+
const {
|
|
308
|
+
dependencies
|
|
309
|
+
} = require(`${m}/package.json`)
|
|
306
310
|
Object.keys(dependencies).forEach(key => {
|
|
307
311
|
if (/-loader$/.test(key)) {
|
|
308
312
|
resolveLoaderAlias[key] = require.resolve(key)
|
|
@@ -350,4 +354,4 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
|
|
|
350
354
|
watchOptions: require('./util').getWatchOptions()
|
|
351
355
|
}, platformWebpackConfig)
|
|
352
356
|
}
|
|
353
|
-
}
|
|
357
|
+
}
|
package/lib/mp/index.js
CHANGED
|
@@ -200,22 +200,23 @@ module.exports = {
|
|
|
200
200
|
|
|
201
201
|
// 使用外层依赖的版本
|
|
202
202
|
alias['regenerator-runtime'] = require.resolve('regenerator-runtime')
|
|
203
|
-
const
|
|
203
|
+
const output = {
|
|
204
|
+
pathinfo: process.env.UNI_MINIMIZE !== 'true',
|
|
205
|
+
filename: '[name].js',
|
|
206
|
+
chunkFilename: '[id].js',
|
|
207
|
+
globalObject: process.env.UNI_PLATFORM === 'mp-alipay' ? 'my' : 'global'
|
|
208
|
+
// sourceMapFilename: '../.sourcemap/' + process.env.UNI_PLATFORM + '/[name].js.map'
|
|
209
|
+
}
|
|
204
210
|
if (process.env.UNI_MINIMIZE === 'true' && process.env.NODE_ENV === 'development') {
|
|
205
|
-
|
|
211
|
+
output.pathinfo = false
|
|
206
212
|
}
|
|
207
213
|
return {
|
|
208
|
-
mode: process.env.
|
|
214
|
+
mode: process.env.NODE_ENV === 'production' ? 'production'
|
|
209
215
|
: 'development',
|
|
210
216
|
entry () {
|
|
211
217
|
return process.UNI_ENTRY
|
|
212
218
|
},
|
|
213
|
-
output
|
|
214
|
-
filename: '[name].js',
|
|
215
|
-
chunkFilename: '[id].js',
|
|
216
|
-
globalObject: process.env.UNI_PLATFORM === 'mp-alipay' ? 'my' : 'global'
|
|
217
|
-
// sourceMapFilename: '../.sourcemap/' + process.env.UNI_PLATFORM + '/[name].js.map'
|
|
218
|
-
},
|
|
219
|
+
output,
|
|
219
220
|
performance: {
|
|
220
221
|
hints: false
|
|
221
222
|
},
|
|
@@ -263,8 +264,7 @@ module.exports = {
|
|
|
263
264
|
}]
|
|
264
265
|
}]
|
|
265
266
|
},
|
|
266
|
-
plugins
|
|
267
|
-
optimization
|
|
267
|
+
plugins
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
chainWebpack (webpackConfig, vueOptions, api) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/vue-cli-plugin-uni",
|
|
3
|
-
"version": "2.0.1-
|
|
3
|
+
"version": "2.0.1-33620211231001",
|
|
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-
|
|
20
|
+
"@dcloudio/uni-stat": "^2.0.1-33620211231001",
|
|
21
21
|
"buffer-json": "^2.0.0",
|
|
22
22
|
"copy-webpack-plugin": "^5.1.1",
|
|
23
23
|
"cross-env": "^5.2.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"wrap-loader": "^0.2.0",
|
|
38
38
|
"xregexp": "4.0.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "0b51b590ac174a12300e3e4149bec762f378b28e"
|
|
41
41
|
}
|
|
@@ -35,7 +35,6 @@ function loader(content) {
|
|
|
35
35
|
const options = (0, _loaderUtils.getOptions)(this) || {};
|
|
36
36
|
// fixed by xxxxxx
|
|
37
37
|
const isNVue = !!options.nvue;
|
|
38
|
-
delete options.nvue;
|
|
39
38
|
(0, _schemaUtils.default)(_options.default, options, {
|
|
40
39
|
name: 'Sass Loader',
|
|
41
40
|
baseDataPath: 'options'
|
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
"webpackImporter": {
|
|
36
36
|
"description": "Enables/Disables default `webpack` importer (https://github.com/webpack-contrib/sass-loader#webpackimporter).",
|
|
37
37
|
"type": "boolean"
|
|
38
|
+
},
|
|
39
|
+
"nvue": {
|
|
40
|
+
"description": "nvue",
|
|
41
|
+
"type": "boolean"
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
"additionalProperties": false
|
|
@@ -41,10 +41,11 @@ const matchCss = /\.css$/i;
|
|
|
41
41
|
const fs = require('fs')
|
|
42
42
|
const preprocessor = require('../../webpack-preprocess-loader/preprocess/lib/preprocess')
|
|
43
43
|
const {
|
|
44
|
-
cssPreprocessOptions
|
|
44
|
+
cssPreprocessOptions,
|
|
45
|
+
nvueCssPreprocessOptions
|
|
45
46
|
} = require('@dcloudio/uni-cli-shared')
|
|
46
|
-
|
|
47
|
-
function webpackImporter(resourcePath, resolve, addNormalizedDependency) {
|
|
47
|
+
// fixed by xxxxxx
|
|
48
|
+
function webpackImporter(resourcePath, resolve, addNormalizedDependency, isNVue) {
|
|
48
49
|
function dirContextFrom(fileContext) {
|
|
49
50
|
return _path.default.dirname( // The first file is 'stdin' when we're using the data option
|
|
50
51
|
fileContext === 'stdin' ? resourcePath : fileContext);
|
|
@@ -63,7 +64,7 @@ function webpackImporter(resourcePath, resolve, addNormalizedDependency) {
|
|
|
63
64
|
if (contents.includes('#endif')) {
|
|
64
65
|
return {
|
|
65
66
|
file,
|
|
66
|
-
contents: preprocessor.preprocess(contents, cssPreprocessOptions.context, {
|
|
67
|
+
contents: preprocessor.preprocess(contents, isNVue ? nvueCssPreprocessOptions.context : cssPreprocessOptions.context, {
|
|
67
68
|
type: cssPreprocessOptions.type
|
|
68
69
|
})
|
|
69
70
|
}
|
|
@@ -112,7 +112,8 @@ module.exports = function (source, map) {
|
|
|
112
112
|
? 'import \'@dcloudio/uni-app-plus/dist/automator.view\''
|
|
113
113
|
: ''
|
|
114
114
|
this.callback(null,
|
|
115
|
-
`
|
|
115
|
+
`
|
|
116
|
+
// @ts-nocheck
|
|
116
117
|
import 'uni-pages?${JSON.stringify({ type: 'view' })}'
|
|
117
118
|
${automatorCode}
|
|
118
119
|
function initView(){
|