Skip to content

Commit

Permalink
fix minified version build
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 23, 2022
1 parent 708834f commit fdbe894
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
});
});
}
});
}

0 comments on commit fdbe894

Please sign in to comment.