-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
91 lines (90 loc) · 2.21 KB
/
vite.config.js
File metadata and controls
91 lines (90 loc) · 2.21 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import legacy from "@vitejs/plugin-legacy";
import devtools from "solid-devtools/vite";
import hexColorTransform from "@lightningtv/vite-hex-transform";
import { configDefaults } from "vitest/config";
import path from "path";
export default defineConfig(({ mode }) => ({
define: {
__DEV__: mode !== "production",
__RTT__: false,
__renderTextBatching__: true,
__enableCompressedTextures__: true,
__calculateFps__: true,
LIGHTNING_DOM_RENDERING: true
},
plugins: [
hexColorTransform({
include: ["src/**/*.{ts,tsx,js,jsx}"]
}),
devtools({
/* features options - all disabled by default */
autoname: true,
locator: {
jsxLocation: true,
componentLocation: true,
targetIDE: "vscode"
}
}),
solidPlugin({
solid: {
moduleName: "@solidtv/solid",
generate: "universal",
builtIns: []
}
}),
legacy({
targets: ["chrome>=38", "not IE 11"],
// polyfills: ["es.promise.finally", "es/map", "es/set"],
// modernPolyfills: true,
additionalLegacyPolyfills: ["whatwg-fetch"],
modernPolyfills: [
// Safari 11 has modules, but throws > ReferenceError: Can't find variable: globalThis
"es.global-this"
]
})
],
build: {
targets: ["chrome>=69"],
minify: "terser",
terserOptions: {
compress: false,
mangle: false,
format: {
comments: false,
beautify: true
}
},
sourcemap: false
},
resolve: {
alias: {
theme: path.resolve(__dirname, "src/theme.ts")
},
conditions: ["@solidtv/source"],
dedupe: [
"solid-js",
"solid-js/universal",
"@solidjs/router",
"@solidtv/renderer",
"@solidtv/solid",
"@solidtv/solid/primitives"
]
},
optimizeDeps: {
exclude: ["@solidtv/solid", "@solidtv/renderer"]
},
server: {
port: 5174,
hmr: true,
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp"
}
},
test: {
exclude: [...configDefaults.exclude, "packages/template/*"],
globals: true
}
}));