From b06980430ded63cb788b915c025844546caed7b4 Mon Sep 17 00:00:00 2001 From: cani1see Date: Tue, 5 Jun 2018 10:14:44 +0800 Subject: [PATCH] =?UTF-8?q?[bug=20fix]=E5=88=A0=E9=99=A4=E6=AE=8B=E7=95=99?= =?UTF-8?q?=E7=9A=84config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mp-compiler/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/mp-compiler/index.js b/lib/mp-compiler/index.js index 345a8b8..4664f80 100644 --- a/lib/mp-compiler/index.js +++ b/lib/mp-compiler/index.js @@ -220,6 +220,16 @@ function compileMP (content, mpOptioins) { configObj.pages = [...new Set(pages)] } emitFile(`${src}.json`, JSON.stringify(configObj, null, ' ')) + } else { + // 删除残留的config + let json_path = `${options.output.path}/${src}.json` + if (fs.existsSync(json_path)) { + fs.unlink(json_path, (err) => { + if (err) { + console.log(err); + } + }) + } } // 生成入口 js