From 897a86851c3fa2a296fbf5ac1b00cd20184ea6fd Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 16 Mar 2019 13:34:39 +0800 Subject: [PATCH] Merge pull request #6024 from CurtisHumphrey/patch-3 Update build-static.js --- lib/core/src/server/build-static.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/core/src/server/build-static.js b/lib/core/src/server/build-static.js index ba60a4313196..de4145665c8a 100644 --- a/lib/core/src/server/build-static.js +++ b/lib/core/src/server/build-static.js @@ -157,17 +157,14 @@ async function buildPreview(configType, outputDir, packageJson, options) { } function prepareFilesStructure(outputDir, defaultFavIcon) { + // clear the output dir + logger.info('clean outputDir..'); + shelljs.rm('-rf', outputDir); + // create output directory if not exists shelljs.mkdir('-p', outputDir); shelljs.mkdir('-p', path.join(outputDir, 'sb_dll')); - // clear the static dir - shelljs.rm('-rf', path.join(outputDir, 'static')); - shelljs.cp(defaultFavIcon, outputDir); - - logger.info('clean outputDir..'); - shelljs.rm('-rf', path.join(outputDir, 'static')); - shelljs.cp(defaultFavIcon, outputDir); }