Skip to content

Commit

Permalink
Merge pull request #886 from ecomfe/min-build
Browse files Browse the repository at this point in the history
fix minified version build
  • Loading branch information
100pah committed Jan 23, 2022
2 parents 232875c + fdbe894 commit c665c44
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 c665c44

Please sign in to comment.