vue-cli build vue main project

Try -one of the project cli basic ini. Create a project

1. Insert a node

Since webpack uses npm in nodes, npm is a default packet management tool similar to Java connection packet management. Download directly from the official website of the node, it is best to download a new version.

Node download and installation reference: https://www.runoob.com/nodejs/nodejs-install-setup.html

2. Install cnpm worldwide

This is a mirror image of Taobao downloading js. Because the internal network speed is poor, please use this image. If you have good network speed, you can ignore it.

npm install -g cnpm --registry = https: //registry.npm.taobao.org:

3. Insert a net bag: web-clown-global level

According to the Web, there is a Web package that depends on the Web, so it must be installed.

cnpm install web-park web-park-click-c? Then execute

Webb -v has output options indicating successful installation

4. Install vue-cli globally

Finally, this topic appeared and installed vue-cli

cnpm install -g vue-cli? Then do the following:

Vue-V version output indicates successful installation

5. Create a project using vue-cli

5.1 Create an empty folder and execute

vue-demo website:

5.2 After some time, some configuration settings will appear in the panel for you to choose, the main default settings are good.

? Project name vue-demo # Project name, click Enter to return to the default name in parentheses (please note that the name cannot contain capital letters here, if an error occurs, the name will no longer contain capital letters), Ruan Yifeng's blog This is the reason for the file. The name should be in lower case for reference.

Project description A Vue.js project #Project description, write anything

? Author ID Author Name:

? Vue independent build # I choose to run plus time to compile

Runtime + components. Recommend to most users

Install Vue router? Yes # You need a Vue router.

? Use ESLint to overwrite your password. Yes # Do you use ESLint as the password reset process ?

Choose ESLint Preliminary Standard # Same as ESlint

Create unit test is #install unit test

Select test run and select #test module as needed

? Use Nightwatch to set up an e2e test. Installation option # e2e test

After creating the project, should npm install and work for you? (Recommended) npm (choose package download method: Npm or yarn.

6. Development and operation projects

Change configuration settings

Run the following command to run the program

npm run dev actually completed the work in pack.json

You can see the interface directly in the browser

7. Package and release the project

Follow the instructions below to wrap the program in a remote folder that looks like npm run dev. The actual command is the content built into the image above.

npm runs the build package dist folder content on the root path of Tomcat or iis, please visit localhost. port:

Sometimes we did not put it on the root server of the Web server. The port / project folder will not be able to access it. At this point, we need to change the configuration assets in the PublicPath index.js folder, and then we can.

8. Add Status Tool

Chrom has a configuration plugin, install it directly, please contact https://chromecj.com/utilities/2018-12/1653.html

devtools download address: https://github.com/vuejs/vue-devtools

3. Summary:

Vue-cli Introduction: Webpage

vue-cli installation

vue-cli create project vue-cli build vue basic project try. Project cli basic ini: JS

Guess you like

Origin www.cnblogs.com/blogst/p/12689487.html