学习笔记(https://blog.youkuaiyun.com/fungleo/article/details/77584701)
0.全局安装vue-cli
npm install vue-cli -g
1.在准备放入项目的文件夹内
vue init webpack demo
2.项目名称是不是demo,是可以直接回车,不是就输出n
? Project name (demo)
3.项目描述,可以直接回车
? Project description (A Vue.js project)
4.作者,写作者名称
? Author
5.需不需要编译器,直接回车
? Vue build (Use arrow keys)
❯ Runtime + Compiler: recommended for most users
Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files -
render functions are required elsewhere
6.需不需要管理路由,直接回车
? Install vue-router? (Y/n)
7.需不需要ESLint来检查代码,也就是使代码更加规范,直接回车
? Use ESLint to lint your code? (Y/n)
8.用那种风格来检查代码,选第一个就好,直接回车
? Pick an ESLint preset (Use arrow keys)
> Standard (https://github.com/standard/standard)
Airbnb (https://github.com/airbnb/javascript)
none (configure it yourself)
9.是否需要测试功能,不需要,输出n,然后回车
? Set up unit tests (Y/n)
10.测试内容,依然是n,然后回车
? Setup e2e tests with Nightwatch? (Y/n)
11.直接回车
? Should we run `npm install` for you after the project has been created? (recommended) (Use arrow keys)
> Yes, use NPM
Yes, use Yarn
No, I will handle that myself
12.npm install 可能会比较慢,可以使用淘宝镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
13. 使用sass/scss需要安装sass-loader
npm install --save sass-loader