-
Notifications
You must be signed in to change notification settings - Fork 174
/
Copy pathvite.config.js
33 lines (30 loc) · 894 Bytes
/
vite.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
import safeParser from 'postcss-safe-parser'
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite'
// Convert import.meta.url to __dirname equivalent
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
hmr: true
},
resolve: {
alias: {
'@': '/src',
'@utils': path.resolve(__dirname, 'src/utils'),
'@content': path.resolve(__dirname, 'src/content'),
'@tailwind': path.resolve(__dirname, 'src/tailwind'),
'@ts-default': path.resolve(__dirname, 'src/ts-default'),
'@ts-tailwind': path.resolve(__dirname, 'src/ts-tailwind'),
},
},
css: {
postcss: {
parser: safeParser
}
}
})