INNER CODE UNIT · JavaScript
build
nullstack/nullstack · scripts/index.js:72
function build({ mode = 'ssr', output, name, skipCache }) {
const environment = 'production'
const progress = require('../builders/logger')('application', environment)
const compiler = getCompiler({ environment, skipCache, name })
if (name) {
process.env.NULLSTACK_ENVIRONMENT_NAME = name
}
compiler.run((error, stats) => {
if (error) {
console.error(error.stack || error)
if (error.details) {
console.error(error.details)
}
} else if (stats.hasErrors()) {
console.info(stats.toString({ colors: true }))
process.exit(1)
}
if (stats.hasErrors()) process.exit(1)