这个模板是来源于关于 vue3 + antd4 + vite4 + pnpm (vue3-antd4-admin)
VSCode + Volar (需要禁用 Vetur) + TypeScript Vue Plugin (Volar).
TypeScript 默认情况下无法处理.vue
导入的类型信息,因此我们将tsc
CLI 替换为vue-tsc
以进行类型检查。
在编辑器中,我们需要 TypeScript Vue Plugin (Volar),以使 typescript 语言服务知道.vue
类型。
如果你觉得独立的 TypeScript 插件不够快,Volar 还实现了Take Over Mode 更具性能。您可以通过以下步骤启用它:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
See Vite Configuration Reference.
pnpm install
pnpm dev
pnpm build
Run Unit Tests with Vitest
pnpm test:unit
Run End-to-End Tests with Cypress
pnpm test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e
before deploying (e.g. in CI environments):
pnpm build
pnpm test:e2e
Lint with ESLint
pnpm lint