Vue + webpack Installation and configuration _webpack

Source: Internet
Author: User


One: Global Install VUE-CLI

1. Install VUE-CLI

NPM install-g VUE-CLI

When I installed the code, I had an error, I performed the rm-rf/usr/lib/node_modules/vue-cli to remove the previous installation, reinstall it, through

2. # Create a new project based on the ' Webpack ' template

Vue Init webpack My-project

3. # Install dependencies, walk you
CD My-project
NPM Install

When performing NPM install, the error was caused by network problems, I executed

CNPM Install

Pass.

4. Through the above, we have completed the installation, the following implementation (develop way):

Since I'm on the Aliyun, so I need to configure the IP

Open File: My-project/build/dev-server.js

Modify the URI to:

var uri = ' http://120.24.37.249: ' + port

You can switch to your own IP.

If you want to replace the port, you can modify it in My-project/config/index.js:

Dev: {
    env:require ('./dev.env '),
    port:8080,

Change the 8080 to the port you want


Enter the My-project directory and execute

NPM Run Dev

, the log executed is:

Done  Compiled successfully in 5078ms                                                                                                  1:03:18 PM

> listening at http://120.24.37.249:8080

You can then access the following:

http://120.24.37.249:8080/







https://segmentfault.com/a/1190000006852262

https://segmentfault.com/a/1190000006852262




NPM Run Dev

Related Article

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.