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

fix(mp-qq): add fix-2648 to app.json (#3419)

上级 899aa5e1
......@@ -16,7 +16,7 @@ export function fix2648(bundle: OutputBundle) {
const { usingComponents } = JSON.parse(appJsonAsset.source.toString()) as {
usingComponents?: Record<string, string>
}
if (usingComponents && !Object.keys(usingComponents).length) {
if (usingComponents && usingComponents['fix-2648']) {
fs.outputFileSync(
path.resolve(process.env.UNI_OUTPUT_DIR, 'fix-2648.json'),
`{"component":true}`
......
......@@ -66,6 +66,17 @@ export const options: UniMiniProgramPluginOptions = {
app: {
darkmode: false,
subpackages: true,
normalize(appJson) {
const hasUsingComponents =
appJson.usingComponents && Object.keys(appJson.usingComponents).length
if (!hasUsingComponents) {
// fix https://github.com/dcloudio/uni-app/issues/2648
appJson.usingComponents = {
'fix-2648': '/fix-2648',
}
}
return appJson
},
},
project: {
filename: 'project.config.json',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册