Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
50 lines (47 loc) · 1.41 KB
/
Copy pathvite.config.js
File metadata and controls
50 lines (47 loc) · 1.41 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
hmr: true,
watch: {
ignored: ['**/public/r/**', '**/public/og/**']
}
},
resolve: {
dedupe: ['react', 'react-dom'],
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'),
'react-virtualized': 'react-virtualized/dist/commonjs'
}
},
css: {
postcss: {
parser: safeParser
}
},
assetsInclude: ['**/*.glb'],
build: {
rollupOptions: {
input: {
index: path.resolve(__dirname, 'index.html'),
'studio-frame': path.resolve(__dirname, 'studio-frame.html'),
'shape-frame': path.resolve(__dirname, 'shape-frame.html')
},
onwarn(warning, warn) {
if (warning.code === 'MODULE_LEVEL_DIRECTIVE' && warning.message.includes('use client')) return;
warn(warning);
}
}
}
});