vite v2.7.13 で確認 npm init vite or yarn create viteでtsの環境を作成していることが前提 (ここではreact-tsを選択) tsconfig.jsonとvite.config.tsそれぞれに以下を追加 // tsconfig.json { "compilerOptions": { // 略 // ↓ 2つ追記 "baseUrl": "./src", "paths": { "~/*": [ "./*" ] } }, // ↓ 追記 "include": [ "**/*.ts", "**/*.tsx" ] } // vite.config.ts import react from "@vitejs/plugin-react" import path from "path" import { defineConfig } from "vite"