Home > Web Front-end > Vue.js > body text

How to package vue.js and put it on the server

藏色散人
Release: 2020-12-21 10:55:45
Original
1806 people have browsed it

How to package vue.js and put it on the server: 1. Modify the configuration "config/index.js" file; 2. Find the packaged file in the project path, and then run "npm run build"; 3. , upload the cccBlog folder to the server.

How to package vue.js and put it on the server

The operating environment of this tutorial: Windows 7 system, Vue version 2.9.6. This method is suitable for all brands of computers.

Recommended related articles: vue.js

1. Modify and configure the config/index.js file

As shown below, change assetsPublicPath: '. /',

productionSourceMap: false

How to package vue.js and put it on the server

2. Run npm run build

and find the packaged file in the project path. The static and index.html files 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.

How to package vue.js and put it on the server

3. Upload the cccBlog folder to the server. Mine is a tomcat server.

How to package vue.js and put it on the server

4. Then access tomcat below The index.html below cccBlog will do.

5. What needs to be noted is: Do not include Chinese characters in the name of the image resource, because if the image is in Chinese, the image may not be displayed when accessed by the server.

The above is the detailed content of How to package vue.js and put it on the server. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template