From 387282dfd474adac6d8191b2e035393715383c6e Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 8 Aug 2022 11:58:47 +0800 Subject: [PATCH] chore: build --- packages/vue-cli-plugin-uni/commands/build.js | 2 +- packages/vue-cli-plugin-uni/lib/commands/custom.js | 2 +- packages/vue-cli-plugin-uni/lib/configure-webpack.js | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/vue-cli-plugin-uni/commands/build.js b/packages/vue-cli-plugin-uni/commands/build.js index 9fc3f402e..cad7e5941 100644 --- a/packages/vue-cli-plugin-uni/commands/build.js +++ b/packages/vue-cli-plugin-uni/commands/build.js @@ -73,7 +73,7 @@ module.exports = (api, options) => { process.env.VUE_CLI_BUILD_TARGET = args.target - if (args['sourcemap']) process.env.SOURCEMAP = args['sourcemap'] + if (args.sourcemap) process.env.SOURCEMAP = args.sourcemap await build(args, api, options) diff --git a/packages/vue-cli-plugin-uni/lib/commands/custom.js b/packages/vue-cli-plugin-uni/lib/commands/custom.js index 1718edb17..f67c43d9d 100644 --- a/packages/vue-cli-plugin-uni/lib/commands/custom.js +++ b/packages/vue-cli-plugin-uni/lib/commands/custom.js @@ -34,7 +34,7 @@ module.exports = function custom (argv) { clean: false, subpackage: argv.subpackage, plugin: argv.plugin, - sourcemap: argv['sourcemap'], + sourcemap: argv.sourcemap }).catch(err => { console.error(err) process.exit(1) diff --git a/packages/vue-cli-plugin-uni/lib/configure-webpack.js b/packages/vue-cli-plugin-uni/lib/configure-webpack.js index e49b473a4..c71ec2b69 100644 --- a/packages/vue-cli-plugin-uni/lib/configure-webpack.js +++ b/packages/vue-cli-plugin-uni/lib/configure-webpack.js @@ -289,8 +289,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt noSources: true, append: false } - if (isInHBuilderX && process.env.SOURCEMAP_PATH) - sourceMapOptions.filename = process.env.SOURCEMAP_PATH + if (isInHBuilderX && process.env.SOURCEMAP_PATH) { sourceMapOptions.filename = process.env.SOURCEMAP_PATH } if (useEvalSourceMap || useSourceMap) { plugins.push(sourceMap.createSourceMapDevToolPlugin(!sourceMapOptions.filename, sourceMapOptions)) } @@ -302,7 +301,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt } } } - + try { if (process.env.UNI_HBUILDERX_PLUGINS) { require(path.resolve(process.env.UNI_HBUILDERX_PLUGINS, 'uni_helpers/lib/bytenode')) -- GitLab