Skip to Content

Vite

安装和配置 Vite 。

创建项目

首先使用以下命令创建一个新的 React 项目 vite

💡
Tip

目前只支持 vite 的 react 模版

npm create vite@latest

添加 canyon 及其配置

npm install babel-plugin-istanbul babel-plugin-canyon -D

配置 swc 插件

vite.config.ts
import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react({ babel:{ plugins:["istanbul","canyon"] } })], })

就是这样

继续查看 第一个覆盖率数据 - 检查