Skip to content

Commit ace3704

Browse files
committed
fix(poi): print serve message via afterPlugins hook
1 parent 3f60047 commit ace3704

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

poi.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@ exports.apply = api => {
1818
*/
1919
delete config.devServer.open
2020

21-
console.log()
22-
console.log('You can now view your app in the browser:')
23-
console.log(`Local: http://${prettyHost}:${colors.bold(port)}`)
24-
console.log()
25-
26-
/**
27-
* Override poi progress plugin
28-
*/
2921
api.hook('createWebpackChain', config => {
22+
config.plugin('print-loading-screen-serve').use({
23+
apply(compiler) {
24+
compiler.hooks.afterPlugins.tap('print-loading-screen-serve', () => {
25+
console.log()
26+
console.log('You can now view your app in the browser:')
27+
console.log(
28+
`Local: http://${prettyHost}:${colors.bold(port)}`
29+
)
30+
console.log()
31+
})
32+
}
33+
})
34+
/**
35+
* Override poi progress plugin
36+
*/
3037
config.plugin('progress').init(
3138
(_, [handler]) =>
3239
new LoadingScreenPlugin({

0 commit comments

Comments
 (0)