您好,欢迎访问一九零五行业门户网

vue.js怎么改端口号

vue.js更改端口号的方法:1、config文件夹中有一个【index.js】其中部分内容如下,port即为端口号,在这里更改;2、【vue 3.x】中修改端口号则需要在项目根目录下创建一个【vue.config.js】。
本教程操作环境:windows10系统、vue2.9,本文适用于所有品牌的电脑。
【相关文章推荐:vue.js】
vue.js更改端口号的方法:
1.vue 2.x
config文件夹中有一个index.js其中部分内容如下,port即为端口号,在这里更改即可。
module.exports = { dev: { env: require('./dev.env'), port: 8080, // 端口号 assetssubdirectory: 'static', assetspublicpath: '/', proxytable: {}, // css sourcemaps off by default because relative paths are "buggy" // with this option, according to the css-loader readme // (https://github.com/webpack/css-loader#sourcemaps) // in our experience, they generally work as expected, // just be aware of this issue when enabling this option. csssourcemap: false, }};
2.vue 3.x
vue 3.x中修改端口号则需要在项目根目录下创建一个vue.config.js,内容如下。
module.exports = { devserver: { port: 8080, // 端口号 }};
相关免费学习推荐:javascript(视频)
以上就是vue.js怎么改端口号的详细内容。
其它类似信息

推荐信息