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

How to deploy vue.js to the server

王林
Release: 2020-11-19 10:12:10
Original
2569 people have browsed it

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.

How to deploy vue.js 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

How to deploy vue.js to the server

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.

How to deploy vue.js to the server

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

How to deploy vue.js to the 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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!