build: throw error when compile style failed

This commit is contained in:
陈嘉涵
2019-09-30 09:53:09 +08:00
parent d7ef84d8cf
commit 48bd6d86d8
2 changed files with 18 additions and 9 deletions

View File

@@ -16,15 +16,19 @@ const tasks = [
'cross-env NODE_ENV=production webpack -p --color --config build/webpack.pkg.js'
];
tasks.forEach(task => {
tasks.every(task => {
signale.start(task);
const interactive = new Signale({ interactive: true });
interactive.pending(task);
const result = shell.exec(`${task} --silent`);
if (result.code !== 0) {
interactive.error(task);
} else {
interactive.success(task);
return false;
}
interactive.success(task);
return true;
});