Vue Environment Setup and project initialization (Windows)

Source: Internet
Author: User

1. Install node. js

Official website Download Install: https://nodejs.org/en/

Version view: node-v

Note: The node version is best to be a little new and recommended for more than 6.0.

2. NPM install Webpacka) command

NPM install-g webpack//Global installation

NPM install-g webpack-dev-server//Installation Debugging Tools

b) Webpack Installation permissions Issues

Open a command prompt (or node. js command Prompt) with administrator privileges if the error that appears indicates that user rights are limited

Open the node. js Command Prompt window as user users:

The administrator opens the node. js Command Prompt window as follows:

3. NPM installation VUE-CLIc) command

NPM install-g VUE-CLI//Global installation

4. Create a new project based on the Webpack template

Note: Vue.js official based on the provided development template introduction See "Vue Development Template Introduction "

Create a project directory D:\\vue_project

Execute the following command under the project directory

Vue init webpack project-name//default installation version 2.0

Vue init webpack#1.0 project-name//Install version 1.0

5. Project directory

6. Installation Project Dependencies

Be sure to install from the official warehouse, NPM server is abroad so this step will be slow to install.

NPM Install

Do not install from the domestic mirror CNPM (which will cause a lot of dependent libraries missing later)

CNPM Install

7. Start the project

NPM Run Dev

8. Release

NPM Run Build

A) Vue-simple-webpack

After the Publish command is executed, the build.js is generated at the time of publication and is compressed.

b) Vue-webpack

After the Publish command is executed, all static resources, including index.html, are generated into the dist directory. That means you can simply take the dist directory to publish your app, such as publishing the Dist directory as a Web site under IIS.

Vue Environment Setup and project initialization (Windows)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.