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.
23 lines
640 B
23 lines
640 B
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.message || 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
|
|
}));
|
|
});
|
|
};
|
|
|