You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
625 B
24 lines
625 B
8 years ago
|
const { build } = require('../src');
|
||
|
const ora = require('ora');
|
||
|
|
||
|
module.exports = (middleware, options) => {
|
||
|
const spinner = ora('Building project').start();
|
||
|
|
||
|
return build(middleware, options)
|
||
|
.fork((errors) => {
|
||
|
spinner.fail('Building project failed');
|
||
|
errors.forEach((err) => {
|
||
|
console.error(err.stack || err);
|
||
|
err.details && console.error(err.details);
|
||
|
});
|
||
|
process.exit(1);
|
||
|
}, (stats) => {
|
||
|
spinner.succeed('Building project completed');
|
||
|
console.log(stats.toString({
|
||
|
colors: true,
|
||
|
chunks: false,
|
||
|
children: false
|
||
|
}));
|
||
|
});
|
||
|
};
|