Skip to content

Commit

Permalink
feat: use import.meta.url for alias and publicDir
Browse files Browse the repository at this point in the history
  • Loading branch information
aekasitt committed Aug 14, 2024
1 parent 279dd19 commit 7b471d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import autoImport from 'unplugin-auto-import/vite'
import autoprefixer from 'autoprefixer'
import { defineConfig } from 'vite'
import path from 'path'
import { fileURLToPath, URL } from 'node:url'
import svgLoader from 'vite-svg-loader'
import vue from '@vitejs/plugin-vue'
import tailwind from 'tailwindcss'
Expand Down Expand Up @@ -32,10 +32,10 @@ export default defineConfig({
svgLoader(),
vue(),
],
publicDir: path.resolve(__dirname, './static'),
publicDir: fileURLToPath(new URL('./static', import.meta.url)),
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})

0 comments on commit 7b471d4

Please sign in to comment.