How to deploy vue.js to the server: 1. Edit the config/index.js file; 2. Run the [npm run build] command; 3. Find the packaged file in the project path and add Just upload the file to the server.
The specific method is as follows:
(Learning video sharing: javascript video tutorial)
1 , edit the config/index.js file, as shown below, change assetsPublicPath: './',
productionSourceMap: false
2. Run npm run build
Then find the packaged file in the project path. The static and index.html under the dist folder of the project file are the packaged files. Then I created the cccBlog folder myself, copied static and index.html to cccBlog, and then uploaded the cccBlog folder to the server.
3. Upload the cccBlog folder to the server. Mine is a tomcat server.
4. Then access tomcat below The index.html below cccBlog will do.
Note: Do not include Chinese characters in the name of the image resource, because if the image resource is in Chinese, the image may not be displayed when accessed by the server.
Related recommendations: vue.js tutorial
The above is the detailed content of How to deploy vue.js to the server. For more information, please follow other related articles on the PHP Chinese website!