Home > Web Front-end > H5 Tutorial > body text

How to use vue-cli to build vue project and webpack?

PHP中文网
Release: 2017-06-22 15:30:03
Original
3010 people have browsed it

I have been using Vue for a long time, and I have done some projects, large and small. Recently, I want to summarize the knowledge points and create a Vue+webpack series. Let’s start with project construction-vue-cli.

Since it is Vue+webpack, I will not go into details about git here. The default environment is configured.

The first step is to create a folder. Here is apronew;

The second step is to open git bash in the folder, and then type the command line npm install --global vue-cli, global Install vue-cli. If it has been installed globally, you do not need to install it again;

Step 3: After the second step is successful, create a new project based on the webpack template and type the command Line: vue init webpack test-vue-cli

When the third step is completed, enter the new init folder and it will look like this

Step 4: Install dependent packages, use the command line npm install (it is recommended to use cnpm Taobao mirror, which is faster)

The installation process is like this

The successful installation is like this

Now you can proceed to the last step and run;

The fifth step: npm run dev; (As for why it is run dev and what is done after typing this command line, I will make up for it later)

If there are dependencies that are not installed, an error will be reported in this step. Just continue to install the corresponding dependencies. When the following status appears, it means you're done!

Using Vue scaffolding to build the project is over!

The above is the detailed content of How to use vue-cli to build vue project and webpack?. 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!