Skip to content

Commit

Permalink
fix(poi): print serve message via afterPlugins hook
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed May 11, 2019
1 parent 3f60047 commit ace3704
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@ exports.apply = api => {
*/
delete config.devServer.open

console.log()
console.log('You can now view your app in the browser:')
console.log(`Local: http://${prettyHost}:${colors.bold(port)}`)
console.log()

/**
* Override poi progress plugin
*/
api.hook('createWebpackChain', config => {
config.plugin('print-loading-screen-serve').use({
apply(compiler) {
compiler.hooks.afterPlugins.tap('print-loading-screen-serve', () => {
console.log()
console.log('You can now view your app in the browser:')
console.log(
`Local: http://${prettyHost}:${colors.bold(port)}`
)
console.log()
})
}
})
/**
* Override poi progress plugin
*/
config.plugin('progress').init(
(_, [handler]) =>
new LoadingScreenPlugin({
Expand Down

0 comments on commit ace3704

Please sign in to comment.