Update publish.cjs

This commit is contained in:
全栈小学生 2025-05-30 09:48:00 +08:00
parent 1ae60052fe
commit 568269b6a7

View File

@ -71,18 +71,23 @@ const solve = () => {
}
const handleWeappAddonComponents = (mode) => {
const src = `./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`
const files = [
`./dist/${mode}/mp-weixin/addon/components/diy/group/index.json`,
`./dist/${mode}/mp-weixin/app/pages/index/tabbar.json`
]
try {
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
data.componentPlaceholder = {};
files.forEach(src => {
try {
const data = JSON.parse(fs.readFileSync(src, 'utf8'));
data.componentPlaceholder = {};
Object.keys(data.usingComponents).map(key => {
data.componentPlaceholder[key] = "view";
})
fs.writeFileSync(src, JSON.stringify(data))
} catch (err) {
}
Object.keys(data.usingComponents).map(key => {
data.componentPlaceholder[key] = "view";
})
fs.writeFileSync(src, JSON.stringify(data))
} catch (err) {
}
})
}
const handleWeappLanguage = (mode) => {