diff --git a/uni-app/publish.cjs b/uni-app/publish.cjs index 2c3ef2590..1d918b678 100644 --- a/uni-app/publish.cjs +++ b/uni-app/publish.cjs @@ -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) => {