The vue-cli3.0 package is uploaded to the server and an error 404 is reported. The creation of vue.config.js, modifies the invalid baseUrl package.

problem description

I created the project using vue-cli 3.0. after build, I uploaded the folder to the server. When I reported an error in css file 404, I saw that Daniel said to create a vue.config.js, in the root directory. Which parameter can solve this problem?

the environmental background of the problems and what methods you have tried

I also tried to create vue.config.js, and modify baseUrl:". /"; then after adding it to the server, I still couldn"t find the css file. I looked at the packaged code again, and the code remained the same

.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

module.exports = {
    baseUrl: "./"
}

what result do you expect? What is the error message actually seen?

you can see the final effect of packaging on the server

Dec.02,2021

baseUrl this change is reflected in index.html under the dist directory.
1, the path is / , and the path of index.html is < script src=/js/chunk-vendors.985c652d.js > < / script > . If you open index.html locally, static resources cannot be accessed and need to be placed on the server before they can be accessed.
2, the path is . / , and index.html the path to the resource is < script src=js/chunk-vendors.985c652d.js > < / script > , which directly opens index.html . Static resources are accessed, of course, only when they are placed on the server.

landlord, if you sit down ~

Menu