提交 dea87d13 编写于 作者: fxy060608's avatar fxy060608

fix(mp): recursive merge platform options

上级 71b13fd7
import { hasOwn, isArray } from '@vue/shared'
import { hasOwn, isArray, isPlainObject } from '@vue/shared'
import { recursive } from 'merge'
import { parseJson } from '../json'
interface ParseMiniProgramProjectJsonOptions {
......@@ -46,7 +47,18 @@ export function parseMiniProgramProjectJson(
if (platformConfig) {
projectKeys.forEach((name) => {
if (hasOwn(platformConfig, name)) {
;(projectJson as Record<string, any>)[name] = platformConfig[name]
if (
isPlainObject(platformConfig[name]) &&
isPlainObject((projectJson as Record<string, any>)[name])
) {
;(projectJson as Record<string, any>)[name] = recursive(
true,
(projectJson as Record<string, any>)[name],
platformConfig[name]
)
} else {
;(projectJson as Record<string, any>)[name] = platformConfig[name]
}
}
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册