Home  >  Article  >  Development Tools  >  How vscode builds a vue project

How vscode builds a vue project

王林
王林Original
2019-12-16 16:54:2016254browse

How vscode builds a vue project

1. Install Vscode, nodejs, etc. in advance.

2. Install vue-cli globally. vue-cli can help us quickly build Vue projects.

Installation command:

npm install -g vue-cli

Open the terminal of VScode and bring up the command input box. Click Terminal-New Terminal, enter the above command, press Enter, and wait for the installation to complete.

How vscode builds a vue project

3. Install webpack, which is a tool for packaging js

Installation command:

npm install -g webpack

The installation method is the same as above.

4. After the installation is complete, you can start creating the vue project. First create a folder to store your project, open the corresponding folder with vscode, and cd to the corresponding folder in the terminal. For example, my folder is myvue

Create project command, enter:

vue init webpack myvue

where myvue is the project name, choose it according to your preference.

How vscode builds a vue project

Then some configuration items will appear, which can be configured as needed, or they can be defaulted and just press Enter.

How vscode builds a vue project

Then continue waiting for the dependencies to be installed. After completion, a basic vue project will be built. After completion, you can see the following directory on the left side of vscode, of which main.js is the entry.

How vscode builds a vue project

5. Then run the project, first cd to the project folder, cd myvue, and then enter the following command

npm run dev

How vscode builds a vue project

After success, enter :http://localhost:8080 in the browser. If you see the following screen, it is successful.

How vscode builds a vue project

6. Project packaging and release online

Enter the command:

npm run build

After completion, a dist folder will appear in the project folder , which contains the packaged content and can be deployed directly.

Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of How vscode builds a vue project. 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