-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
49 lines (48 loc) · 1.23 KB
/
vite.config.js
File metadata and controls
49 lines (48 loc) · 1.23 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
// @ts-check
import { defineConfig } from 'vite'
import browserslist from 'browserslist'
import { browserslistToTargets } from 'lightningcss'
import preact from '@preact/preset-vite'
// https://vitejs.dev/config/
export default defineConfig({
define: {
global: 'globalThis'
},
plugins: [
preact({
devtoolsInProd: false,
prefreshEnabled: true,
})
],
// https://github.com/vitejs/vite/issues/8644#issuecomment-1159308803
esbuild: {
logOverride: { 'this-is-undefined-in-esm': 'silent' }
},
publicDir: '_public',
css: {
transformer: 'lightningcss',
lightningcss: {
targets: browserslistToTargets(browserslist('>= 0.25%')),
},
},
server: {
port: 8888,
host: true,
open: true,
proxy: {
'/api': {
target: 'http://localhost:9999/.netlify/functions',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
build: {
cssMinify: 'lightningcss',
target: 'esnext',
minify: false,
outDir: './public',
emptyOutDir: true,
sourcemap: 'inline'
}
})