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