热加载
serve.js/* 代码首行 */ const fs=require("fs"); /* 任意空白位置 */ function deleteFolder(path) { let files = []; if( fs.existsSync(path) ) { files = fs.readdirSync(path); files.forEach(function(file,index){ let curPath = path + "/" + file; if(fs.statSync(curPath).isDirectory()) { deleteFolder(curPath); } else { fs.unlinkSync(curPath); } }); fs.rmdirSync(path); } } 复制代码var outputFolder = getOutputFolder(args);if (server.isRunning()) deleteFolder(outputFolder) 复制代码
最后更新于