Skip to content

Commit 8c223e1

Browse files
committed
fix: make vite config ESM-compatible
1 parent 0a22d02 commit 8c223e1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

vite.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from "vite"
2+
import react from "@vitejs/plugin-react"
33
import path from "path"
4+
import { fileURLToPath } from "url"
5+
6+
// ESM-compatible __dirname
7+
const __filename = fileURLToPath(import.meta.url)
8+
const __dirname = path.dirname(__filename)
49

5-
// https://vite.dev/config/
610
export default defineConfig({
711
plugins: [react()],
812
resolve: {

0 commit comments

Comments
 (0)