从现在开始假设已经安装好了,vue-cli、node、等
官方文档:
Vue CLI 3 和旧版使用了相同的 vue
命令,所以 Vue CLI 2 (vue-cli
) 被覆盖了。如果你仍然需要使用旧版本的 vue init
功能,你可以全局安装一个桥接工具:
npm install -g @vue/cli-init
# `vue init` 的运行效果将会跟 `vue-cli@2.x` 相同
vue init webpack my-project
vue init webpack . // 创建项目到当前目录
Generate project in current directory? Yes
Project name rippletest
Project description A Vue.js project
Author moquan0116 <330898472@qq.com>
Vue build (Use arrow keys) // 以什么方式构建vue
> 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
Install vue-router? (Y/n) // 安装路由,不用多说了
Use ESLint to lint your code? (Y/n) // eslint 代码规范检测
Standard (https://github.com/standard/standard) // JavaScript 代码规范,自带 linter & 代码自动修正
Airbnb (https://github.com/airbnb/javascript) // 暂不不明白
none (configure it yourself)
Set up unit tests (Y/n) // 设置单元测试
Pick a test runner // 选择一个测试运行程序, 以下均无了解,待完善
> Jest
Karma and Mocha
none (configure it yourself)
Setup e2e tests with Nightwatch? (Y/n) // 还是没有了解
是否在项目创建后运行'npm install'
Should we run `npm install` for you after the project has been created? (recommended)
> Yes, use NPM
Yes, use Yarn
No, I will handle that myself