Skip to content

Commit

Permalink
fix multi target
Browse files Browse the repository at this point in the history
Update package.json
  • Loading branch information
ljqx committed Jun 5, 2017
1 parent 6f7ed27 commit fe903b9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tasks/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = (grunt) => {
const done = this.async();

const targets = cliTarget ? [cliTarget] : Object.keys(grunt.config([this.name]));
let runningTargetCount = targets.length;

targets.forEach((target) => {
if (target === 'options') return;

Expand Down Expand Up @@ -64,7 +66,13 @@ module.exports = (grunt) => {
}
}

if (!opts.keepalive) done();
if (!opts.keepalive) {
runningTargetCount -= 1;

if (runningTargetCount === 0) {
done();
}
}
};

if (opts.watch) {
Expand Down

0 comments on commit fe903b9

Please sign in to comment.