From 568269b6a74b5c71667d5b2a2c13446d32b5db94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=A8=E6=A0=88=E5=B0=8F=E5=AD=A6=E7=94=9F?= <1518079521@qq.com> Date: Fri, 30 May 2025 09:48:00 +0800 Subject: [PATCH] Update publish.cjs --- uni-app/publish.cjs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) 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) => {