企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1、webpack.dev.conf.js ``` module.exports\=newPromise((resolve, reject) \=> {   portfinder.basePort\=process.env.PORT || config.dev.port   portfinder.getPort((err, port) \=> { if (err) { reject(err)     } else { // publish the new Port, necessary for e2e tests process.env.PORT \=port // add port to devServer config devWebpackConfig.devServer.port \=port // Add FriendlyErrorsPlugin devWebpackConfig.plugins.push(newFriendlyErrorsPlugin({ compilationSuccessInfo: { // messages: \[`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`\], //}, messages: \[ `App runing at: `, `Local: http://localhost:${port}`, `Network: http://${require('ip').address()}:${port}`,         \],       }, onErrors: config.dev.notifyOnErrors ? utils.createNotifierCallback() :undefined       })) resolve(devWebpackConfig)     }   }) }) ``` 2、config/index.js ``` dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: {}, // Various Dev Server settings host: '0.0.0.0', // can be overwritten by process.env.HOST主要是把这里修改成0.0.0.0 ```