Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
webpack(webpackConfig).run((error, stats) => {
if (error) {
showError(error, program)
return 1
}
const jsonStats = stats.toJson()
if (stats.hasErrors()) {
return jsonStats.errors.map(showError)
}
if (stats.hasWarnings()) {
showWarning('Webpack generated the following warnings: ')
jsonStats.warnings.map(showWarning)
}
console.log(`Webpack stats: ${stats}`)
showSuccess(
`Your library is compiled in production mode in: \n${outputFolder}`
)
return 0
})