提交 3e5d84c8 编写于 作者: X xf00000000

fix:修正package.json配置自定义编译条件覆盖为false

如果有package.json下的uni-app->scripts配置有两个平台以上且有相同的自定义编译条件变量时会导致变量覆盖为false
上级 7a22ae9e
...@@ -35,7 +35,9 @@ module.exports = { ...@@ -35,7 +35,9 @@ module.exports = {
if (scriptName !== name) { if (scriptName !== name) {
const define = uniAppOptions.scripts[scriptName].define const define = uniAppOptions.scripts[scriptName].define
Object.keys(define).forEach(name => { Object.keys(define).forEach(name => {
define[name] = false if (typeof scriptOptions.define[name] === "undefined") {
define[name] = false
}
}) })
Object.assign(scriptOptions.define, define) Object.assign(scriptOptions.define, define)
} }
...@@ -50,4 +52,4 @@ module.exports = { ...@@ -50,4 +52,4 @@ module.exports = {
return scriptOptions return scriptOptions
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册