Vue (a) vue-cli quickly build project

A: Basic configuration environment

  (1) must first download the node (https://nodejs.org/zh-cn/download/);

  (2) Open a terminal type:

    node --version
    npm --version

 

  (3) if this number on display publication are already installed OK;

       

  

  (4) mounted scaffolding (vue-cli)

    npm install @ vue / cli -g // global install the latest Scaffolding

 

Two: to build the project

  (1) generation project directory

    vue create the project name (seemingly can not contain capital letters);

   

  (2) select manual configuration or default configuration

      default default configuration

      Manually select features manual configuration

  

  (3) where we choose to manually configure, here is my choice

    

  

  (4) where it is let's examine what we have just chosen configuration, and then asked us not to use history mode, in fact, it is our page does not contain routing with #; here we choose Y

    

  

  (5) Select CSS preprocessor, here we choose Less, in fact, almost what the election will do, you would use the election, it is not also directly with native hate;

    

  

  (6) selecting ESLint Code validation rules, providing a plug of javascript code detecting means, where we choose ESLint + Prettier;

    

   

  (7) to choose when code verification, Lint on save to save checks, Lint and fix on time to commit fix or commit check, here we choose the first, stable;

    

  

  (8) where it is the choice to save our configuration file to which the, In dedicated config files stored in a separate file, In package.json stored in package.json, the place where we choose in package.json;

    

  

  (9) where we are asked if we would want to save our configuration down, after the project is. Here we can not choose, it does not always take the time to manually configure;

    

  

  (10)到这里傻瓜式搭建项目就结束了,通过8080端口就可以访问了;有时间还是建议去看看vue-cli脚手架的源码,研究一下实现原理;

    

Guess you like

Origin www.cnblogs.com/blcorder/p/12015715.html