webpack篇(三):serve启动 打印台友好提示

方式一:stats对象

方式二:friendly-errors-webpack-plugin插件

npm i --save-D friendly-errors-webpack-plugin

webpack.config.js

plugins: [
    new FriendlyErrorsWebpackPlugin({
      compilationSuccessInfo: {
        messages: ['You application is running here http://localhost:3000'],
        notes: ['Some additionnal notes to be displayed unpon successful compilation']
      },
      onErrors: function (severity, errors) {
        // You can listen to errors transformed and prioritized by the plugin
        // severity can be 'error' or 'warning'
      },
    })
  ]

 

posted @ 2021-04-09 16:35  玛卡巴鉲  阅读(193)  评论(0编辑  收藏  举报