ソースを参照

:gear: hotfix for module vite config

tags/0.0.1^2
J 3年前
コミット
d1c7dd2dca
1個のファイルの変更7行の追加1行の削除
  1. 7
    1
      frontend/vite.config.js

+ 7
- 1
frontend/vite.config.js ファイルの表示

@@ -1,6 +1,12 @@
1 1
 import { defineConfig } from 'vite'
2 2
 import vue from '@vitejs/plugin-vue'
3 3
 
4
+import path from 'path'
5
+import { fileURLToPath } from 'url'
6
+
7
+const filename = fileURLToPath(import.meta.url)
8
+const dirname = path.dirname(filename)
9
+
4 10
 // https://vitejs.dev/config/
5 11
 export default defineConfig({
6 12
     css: {
@@ -14,7 +20,7 @@ export default defineConfig({
14 20
     plugins: [vue()],
15 21
     resolve: {
16 22
         alias: {
17
-            '@': require('path').resolve(__dirname, 'src'),
23
+            '@': path.resolve(dirname, 'src'),
18 24
         },
19 25
     },
20 26
 })

読み込み中…
キャンセル
保存