In the Vue project, sometimes we need to modify the startup path of the project, but we find that the modification does not take effect. Below I'll describe some possible solutions.
- Make sure you modify the correct files
When we want to modify the startup path of the Vue project, we usually need to modify vue.config.js
the file. Please make sure you modify the correct file and not another configuration file.
- Configure publicPath
In vue.config.js
the file, you can publicPath
modify the project's startup path through configuration. This path specifies the base path of the project on the server, which can be a relative path or an absolute path.
Here is an example vue.config.js
file:
module.exports = {
publicPath: '/your-custom-path/',
};
In the above example, we modified the startup path to /your-custom-path/
. You can according to your project