first of all, my project is not in the root directory of the server, so it is assumed that the directory name is website to facilitate the following description
according to what I said on the Internet, I set the build.assetsPublicPath under config/index.js
to"/ website/", and started
history
mode, routing is set to base:"/ website/"
question:
-
After the
- project is deployed to the server, I want to add the
prerender-spa-plugin
pre-dyeing plug-in, but I always report an error when generating the file. After google has checked the relevant information ( github ), I found that it is becausebuild.assetsPublicPath
is set, and only the default/
can be successful, but the project directory cannot be moved. This question is shelved - then, there is another problem with the deployment of the project to the server. Sometimes the click route is invalid. Check the console and find that the error is as follows:
Error: Loading chunk 4 failed. at HTMLScriptElement...
and google found that it is necessary to change assetsPublicPath
, manual sweat ~
I just want to know how I can successfully deploy to the server subdirectory without path reference errors after setting assetsPublicPath
as the default /
.