In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of how to modify the port number of the vue project, the content is detailed and easy to understand, the operation is simple and quick, and has a certain reference value. I believe you will gain something after reading this vue project article on how to modify the port number. Let's take a look.
Method: 1, modify the "port" item content in the "config\ index.js" folder, "port" represents the port number, this method can permanently modify the VUE project startup port number; 2, use "module.exports= {devServer: {port: Port number,}" to modify.
This article operating environment: windows10 system, Vue2.9.6 version, DELL G3 computer.
How to change the port number of vue project
1.Vue 2.x
There is an index.js in the config folder, some of which are as follows. Port is the port number, and you can change it here.
Module.exports = {dev: {env: require ('. / dev.env'), port: 8080, / / Port number 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
To change the port number in Vue 3.x, you need to create a vue.config.js under the root of the project, as follows.
Module.exports = {devServer: {port: 8080, / / Port number}}; this is the end of the article on "how to modify the port number of the vue project". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to change the port number of the vue project". If you want to learn more, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.