From 63ec67b764fae38b4db736c3dc7155c365e3cd9e Mon Sep 17 00:00:00 2001 From: jerry4718 Date: Wed, 23 Sep 2020 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?webpack=E7=9A=84dev=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=AF=E5=8A=A8=E4=BF=A1=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.dev.conf.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 070ae22..6d77bd4 100644 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -70,6 +70,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { module.exports = new Promise((resolve, reject) => { portfinder.basePort = process.env.PORT || config.dev.port + portfinder.getPort((err, port) => { if (err) { reject(err) @@ -79,10 +80,26 @@ module.exports = new Promise((resolve, reject) => { // add port to devServer config devWebpackConfig.devServer.port = port + let baseUrl = `http://${devWebpackConfig.devServer.host}:${port}`; + // Add FriendlyErrorsPlugin devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ compilationSuccessInfo: { - messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], + messages: [`Your application is running here: ${baseUrl}`].concat([ + `主页的网址为 ${baseUrl}/#/ DARKMOD ${baseUrl}/#/dark`, + `编程开发类的网址是 ${baseUrl}/#/programming DARKMOD ${baseUrl}/#/darkprogramming`, + `主题美化类的网址是 ${baseUrl}/#/themes DARKMOD ${baseUrl}/#/darkthemes`, + `音乐欣赏类的网址是 ${baseUrl}/#/musicandsound DARKMOD ${baseUrl}/#/darkmusicandsound`, + `游戏娱乐类的网址是 ${baseUrl}/#/games DARKMOD ${baseUrl}/#/darkgames`, + `作图/看图类的网址是 ${baseUrl}/#/photos DARKMOD ${baseUrl}/#/darkphotos`, + `社交软件类的网址是 ${baseUrl}/#/relations DARKMOD ${baseUrl}/#/darkrelations`, + `实用工具类的网址是 ${baseUrl}/#/tools DARKMOD ${baseUrl}/#/darktools`, + `视频观看类的网址是 ${baseUrl}/#/videos DARKMOD ${baseUrl}/#/darkvideos`, + `其他应用类的网址是 ${baseUrl}/#/others DARKMOD ${baseUrl}/#/darkothers`, + `网络应用类的网址是 ${baseUrl}/#/network DARKMOD ${baseUrl}/#/darknetwork`, + `办公学习类的网址是 ${baseUrl}/#/office DARKMOD ${baseUrl}/#/darkoffice`, + `阅读写作类的网址是 ${baseUrl}/#/reading DARKMOD ${baseUrl}/#/darkreading`, + ]), }, onErrors: config.dev.notifyOnErrors ? utils.createNotifierCallback() -- Gitee