From fdbe894afdf592766a3fc7eb490bd2acad80088a Mon Sep 17 00:00:00 2001 From: pissang Date: Sun, 23 Jan 2022 15:15:25 +0800 Subject: [PATCH] fix minified version build --- build/build.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/build/build.js b/build/build.js index 6f80edf22..d246fd6c1 100644 --- a/build/build.js +++ b/build/build.js @@ -97,20 +97,22 @@ else { rollup.rollup({ ...createInputOption('development', false) }).then(bundle => { - bundle.write(outputOption); - }); - // Minified - if (process.argv.indexOf('--minify') >= 0) { - rollup.rollup({ - ...createInputOption('production', false) - }).then(bundle => { - const file = outputOption.file.replace(/.js$/, '.min.js'); - bundle.write(Object.assign(outputOption, { - file, - sourcemap: false - })).then(function () { - minify(file); + bundle.write(outputOption) + .then(() => { + // Minified + if (process.argv.indexOf('--minify') >= 0) { + rollup.rollup({ + ...createInputOption('production', false) + }).then(bundle => { + const file = outputOption.file.replace(/.js$/, '.min.js'); + bundle.write(Object.assign(outputOption, { + file, + sourcemap: false + })).then(function () { + minify(file); + }); + }); + } }); - }); - } + }); }