Skip to content

Commit

Permalink
fix(build): watching stopped when compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed May 13, 2019
1 parent 2376cff commit 1626613
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions packages/mars-build/src/compiler/file/compiler.js
Expand Up @@ -98,12 +98,12 @@ exports.gulpPlugin = function (options) {
return cb();
}
if (file.isBuffer()) {
try {
compile(file, options).then(_ => cb(null, file));
}
catch (e) {
log.error('[COMPILE ERROR]:', e);
}
compile(file, options)
.then(_ => cb(null, file))
.catch(err => {
log.error('[COMPILE ERROR]:', err);
cb(null, file);
});
return;
}
// for other file type
Expand Down
12 changes: 6 additions & 6 deletions packages/mars-build/src/gulp-mars-base.js
Expand Up @@ -69,12 +69,12 @@ function gulpPlugin(opt = {dest: './dist'}, compilers) {
return cb();
}
if (file.isBuffer()) {
try {
compile(file, opt, compilers).then(_ => cb(null, file));
}
catch (e) {
log.error('[COMPILE ERROR]:', e);
}
compile(file, opt, compilers)
.then(_ => cb(null, file))
.catch(err => {
log.error('[COMPILE ERROR]:', err);
cb(null, file);
});
}
});
return stream;
Expand Down

0 comments on commit 1626613

Please sign in to comment.