mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 18:49:02 +08:00
25 lines
561 B
JavaScript
25 lines
561 B
JavaScript
import ora from 'ora'
|
|
import webpack from 'webpack'
|
|
import config from './webpack.config'
|
|
|
|
const spinner = ora('Building …')
|
|
|
|
export default new Promise((resolve, reject) => {
|
|
spinner.start()
|
|
|
|
webpack(config, (error, stats) => {
|
|
if (error) {
|
|
return reject(error)
|
|
}
|
|
|
|
if (stats.hasErrors()) {
|
|
process.stdout.write(stats.toString() + "\n");
|
|
return reject(new Error('Build failed with errors.'))
|
|
}
|
|
|
|
return resolve('Build complete.')
|
|
})
|
|
})
|
|
.then(success => spinner.succeed(success))
|
|
.catch(error => spinner.fail(error))
|