Skip to content

Commit

Permalink
config: Fix the 'dist' command
Browse files Browse the repository at this point in the history
Fixes bug in the 'dist' npm command where the final Zip files did not
contain all the necessary files due to async code. See #76
  • Loading branch information
fabiodrg committed Mar 2, 2021
1 parent 54559e8 commit 76584fe
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,24 @@ function manifest() {
// .pipe(dest(`build/${target}/styles`))
// }

function mergeAll(done) {
pipe('./src/css/**/*', `./build/${target}/css`)
pipe('./src/extra/**/*', `./build/${target}/extra`)
pipe('./src/icons/**/*', `./build/${target}/icons`)
pipe('./src/js/**/*', `./build/${target}/js`)
pipe(['./src/changelog.html', './src/options.html'], `./build/${target}`)
done()
function moveCss() {
return pipe('./src/css/**/*', `./build/${target}/css`);
}

function moveExtra() {
return pipe('./src/extra/**/*', `./build/${target}/extra`);
}

function moveIcons() {
return pipe('./src/icons/**/*', `./build/${target}/icons`);
}

function moveJs() {
return pipe('./src/js/**/*', `./build/${target}/js`);
}

function moveHtml() {
return pipe(['./src/changelog.html', './src/options.html'], `./build/${target}`);
}

function zip() {
Expand Down Expand Up @@ -121,7 +132,7 @@ function pipe(src, ...transforms) {
// Export tasks
exports.zip = series(zip)
exports.clean = series(cleanBuild, cleanDist)
exports.build = series(exports.clean, manifest, mergeAll)
exports.dist = series(exports.build, series(zip))
exports.build = series(exports.clean, manifest, parallel(moveHtml, moveCss, moveJs, moveExtra, moveIcons))
exports.dist = series(exports.build, zip)
exports.watch = series(exports.build, startWatching)
exports.default = exports.build;

0 comments on commit 76584fe

Please sign in to comment.