From 25684c211d3c7d32e068824deaf9a9357a8cb71c Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Thu, 13 Apr 2023 23:27:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=B1=80=E5=9F=9F?= =?UTF-8?q?=E7=BD=91=E5=8F=AF=E8=AE=BF=E9=97=AE=EF=BC=8C=E7=94=A8ifconfig/?= =?UTF-8?q?ipconfig=E8=8E=B7=E5=8F=96=E6=9C=AC=E6=9C=BAip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/build/webpack.dev.conf.js | 8 ++++---- fe/config/index.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fe/build/webpack.dev.conf.js b/fe/build/webpack.dev.conf.js index 070ae22..dd80e71 100644 --- a/fe/build/webpack.dev.conf.js +++ b/fe/build/webpack.dev.conf.js @@ -78,15 +78,15 @@ module.exports = new Promise((resolve, reject) => { process.env.PORT = port // add port to devServer config devWebpackConfig.devServer.port = port - + let host = devWebpackConfig.devServer.host === '0.0.0.0' ? 'localhost' : devWebpackConfig.devServer.host // 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: http://${host}:${port}`] }, onErrors: config.dev.notifyOnErrors - ? utils.createNotifierCallback() - : undefined + ? utils.createNotifierCallback() + : undefined })) resolve(devWebpackConfig) diff --git a/fe/config/index.js b/fe/config/index.js index feaa3f8..e8af876 100644 --- a/fe/config/index.js +++ b/fe/config/index.js @@ -18,7 +18,7 @@ module.exports = { }, // Various Dev Server settings - host: '127.0.0.1', // can be overwritten by process.env.HOST + host: '0.0.0.0', // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true,