? Check the features needed for your project :(*) Choose vue version # 选择vue版本(*) Babel # 代码编译(*) TypeScript # ts() Progressive Web App(PWA)Support # 支持渐进式网页应用程序(*) Router # vue路由() vuex # 状态管理模式() css Pre-processors # css预处理(*) Linter ; Formatter # 代码风格、格式校验() Unit Testing # 单元测试()E2E Testing # 端对端测试
TypeScript 选项配置
# 选择使用哪个版本的vue框架
? Choose a version of Vue.js that you want to start the project with2.x # vue2.x
3.x # vue3.x
# 询问的是是否使用class风格的组件语法,如果在项目中想要保持使用TypeScript的class风格的话,建议大家选择y。
? Use class-style component syntax?(Y/n)
# 使用Babel与TypeScript一起用于自动检测的填充?这里一定要选择y
? Use Babel alongside TypeScript(required for modern mode, auto-detected polyfills, transpiling JSX)?(Y/n)
Router 选项配置
# 路由是否使用history模式?如果项目中存在要求就使用history(即:y),但是一般还是推荐大家使用ha模式,毕竟history模式需要依赖运维。
? Use history mode for router?(Requires proper server setup for index fallback in production)(Y/n)
CSS Pre-processors css 选项配置
# 选择一种CSS预处理类型,根据各个项目的要求使用对应css编译处理
? Pick a CSS pre-processor(PostCSS, Autoprefixer and CSS Modules are supported by default):(Use arrow keys)> Sass/SCSS(with dart-sass)
Sass/SCSS(with node-sass)
Less
Stylus
Linter / Formatter 选项配置
# TSLint只有在选择TypeScript时才会存在。
? Pick a linter / formatter config:(Use arrow keys)> ESLint with error prevention only # 只进行报错提醒
ESLint + Airbnb config # 不严谨模式
ESLint + Standard config # 正常模式
ESLint + Prettier # 严格模式
TSLint(deprecated) # TypeScript格式验证工具
# 选择校验时机,一般都会选择保存时校验,好及时做出调整
? Pick additional lint features:(Press <space> to select,<a> to toggle all,<i> to invert selection)(*) Lint on save # 保存时检测() Lint and fix on commit # 修复和提交时检测
Unit Testing 选项配置
# 选择单元测试解决方案,普遍用到最多的是Mocha + chai
? Pick a unit testing solution:(Use arrow keys)> Mocha + Chai
Jest
# 选择Babel,PostCSS, ESLint等自定义配置的存放位置。这里建议大家选择第一个
? Where do you prefer placing config for Babel, ESLint, etc.?(Use arrow keys)> In dedicated config files # 存放在专用配置文件中
In package.json # 存放在package.json中
# 是否保存当前选择的配置项,如果当前配置是经常用到的配置,建议选择y存储一下当前配置项
? Save thisas a preset for future projects?(y/N)
# 选择n之后则会直接开始创建项目了,选择y之后则会输入一个存储当前配置项的名称:? Save preset as: