2019-07-09 13:09:17 +08:00

22 lines
463 B
JavaScript

const webpack = require('webpack')
const configCreator = require('./webpack.config')
const webpackConfig = configCreator(process.env, {mode: 'production'})
webpack(webpackConfig, (err, stats) => {
if (err) {
throw err
}
const info = stats.toJson()
if (stats.hasErrors()) {
console.error(info.errors)
}
if (stats.hasWarnings()) {
console.warn(info.warnings)
}
console.log(stats.toString({
chunks: false,
colors: true
}))
})