@vitejs/plugin-react
esbuild と Babel を使用し、小さなパッケージフットプリントで高速な HMR や、Babel 変換パイプラインを使用できる柔軟性を実現します。
code:vitest.config.ts
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
});
vitestでreact関連のtestをする時に必要になるっぽい ないと以下のようなエラーが出る
code:error
Error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
hooksだけのtestだといらないけど、test code上で<Hoge />のようにtsx書くなら必要