In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "vue-cli3.0 changes the packaged file name and file address after the run error report how to solve", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how to solve the error report after vue-cli3.0 modifies the packaged file name and file address.
Vue-cli3.0 modified the problem description of the packaged file address and file name
Recently, when developing a web-side vue project, vue-cli3.0 was used to build the project directory. Everything went well during the development process without any problems. There was a problem when the development was completed, packaged and launched. The packaged files are in the dist directory by default. When you open index.html, you find that it cannot run. The error is as follows:
Now there are two questions.
I want to change the name of the packaged folder
The solution to the above error reporting problem
After searching on the Internet, I found that everyone said to modify the configuration of the config/index.js file. The problem is that the project is built in cli3.0. There is no config folder at all.
Modify file name
After query, the original 3.0 project has cancelled the config folder, and all configurations are configured in the outermost vue.config.js file, as shown below:
To change the file name, you only need to set the outputDir option:
Module.exports = {outputDir: "myProject" / / packaged project directory name} error resolution
Many of the error reporting problems on the Internet are to modify the path of build in config/index.js, but the vue.config.js of vue-cli3.0 cannot directly write build objects. Another way is to modify the baseUrl in it. When you run it, it will prompt that baseUrl has been abandoned. Please use publicPath instead.
If you find the problem, you can simply modify the publicPath:
Module.exports = {publicPath: ". /" / / basic path}
Npm run build again, generate the name of the file directory you want, and the index.html in it can be opened normally.
Error caused by vue folder name modification
In general, in this case, you change the name of the original folder, so you can change it back.
At this point, I believe that everyone on the "vue-cli3.0 modified packaged file name and file address after the run error report how to solve" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.