Skip to content

Commit

Permalink
feat(app-webpack): ensure potential mode build error is printed to th…
Browse files Browse the repository at this point in the history
…e terminal #17138
  • Loading branch information
rstoenescu committed May 6, 2024
1 parent e42e7c7 commit e37de70
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions app-webpack/lib/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,41 +257,46 @@ async function build () {
// free up memory
webpackData = void 0

finalizeBuild(argv.mode, ctx, quasarConfFile).then(async () => {
outputFolder = argv.mode === 'cordova'
? path.join(outputFolder, '..')
: outputFolder

banner(argv, 'build', { outputFolder, transpileBanner: quasarConf.__transpileBanner })

if (typeof quasarConf.build.afterBuild === 'function') {
await quasarConf.build.afterBuild({ quasarConf })
}

// run possible beforeBuild hooks
await extensionRunner.runHook('afterBuild', async hook => {
log(`Extension(${ hook.api.extId }): Running afterBuild hook...`)
await hook.fn(hook.api, { quasarConf })
finalizeBuild(argv.mode, ctx, quasarConfFile)
.catch(err => {
console.error(err)
fatal('Failed to finalize build (check the log above)', 'FAIL')
})
.then(async () => {
outputFolder = argv.mode === 'cordova'
? path.join(outputFolder, '..')
: outputFolder

if (argv.publish !== void 0) {
const opts = {
arg: argv.publish,
distDir: outputFolder,
quasarConf
}
banner(argv, 'build', { outputFolder, transpileBanner: quasarConf.__transpileBanner })

if (typeof quasarConf.build.onPublish === 'function') {
await quasarConf.build.onPublish(opts)
if (typeof quasarConf.build.afterBuild === 'function') {
await quasarConf.build.afterBuild({ quasarConf })
}

// run possible onPublish hooks
await extensionRunner.runHook('onPublish', async hook => {
log(`Extension(${ hook.api.extId }): Running onPublish hook...`)
await hook.fn(hook.api, opts)
// run possible beforeBuild hooks
await extensionRunner.runHook('afterBuild', async hook => {
log(`Extension(${ hook.api.extId }): Running afterBuild hook...`)
await hook.fn(hook.api, { quasarConf })
})
}
})

if (argv.publish !== void 0) {
const opts = {
arg: argv.publish,
distDir: outputFolder,
quasarConf
}

if (typeof quasarConf.build.onPublish === 'function') {
await quasarConf.build.onPublish(opts)
}

// run possible onPublish hooks
await extensionRunner.runHook('onPublish', async hook => {
log(`Extension(${ hook.api.extId }): Running onPublish hook...`)
await hook.fn(hook.api, opts)
})
}
})
})
}

Expand Down

0 comments on commit e37de70

Please sign in to comment.