-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
36 lines (35 loc) · 1.02 KB
/
vite.config.ts
File metadata and controls
36 lines (35 loc) · 1.02 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import greycat from '@greycat/web/vite-plugin';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
base: '', // makes path relative to there deployment directory
plugins: [greycat()],
appType: 'mpa',
esbuild: {
supported: {
'top-level-await': true, // browsers can handle top-level-await features
},
},
publicDir: resolve(__dirname, 'frontend/public'),
root: resolve(__dirname, 'frontend/pages'),
define: {
// This ensures libraries that leverages 'process.env.NODE_ENV'
// have it replaced statically before dead-code removal
'process.env.NODE_ENV': JSON.stringify(mode),
},
css: {
transformer: 'lightningcss',
},
build: {
outDir: resolve(__dirname, 'webroot'),
cssMinify: 'lightningcss',
rollupOptions: {
input: {
index: resolve(__dirname, 'frontend/pages/index.html'),
},
},
},
};
});