Home  >  Article  >  Web Front-end  >  How to package vue-cli and go online

How to package vue-cli and go online

php中世界最好的语言
php中世界最好的语言Original
2018-05-31 09:58:361228browse

This time I will show you how to package and launch vue-cli. What are the precautions for vue-cli packaging and launch? The following is a practical case, let's take a look.

Take the official example created by vue as an example. When we develop the environment, we will npm run dev to generate

and want to package it into a copy

Very simple, just need npm run build This command

Configuration files of these two commandsIn the index.js of config, one is build and the other is dev , and if we want to view the packaged results locally, we need to change its path in assetsPublicPath. For the specific reason, you can see the file path introduced by index.html

After that, you just need to run it on the server.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to package the vue project to the server

How to deal with es6 syntax errors in webstorm and .vue

How to use webstorm to add *.vue files

The above is the detailed content of How to package vue-cli and go online. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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