-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvite.config.mts
More file actions
67 lines (66 loc) · 2.13 KB
/
vite.config.mts
File metadata and controls
67 lines (66 loc) · 2.13 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
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";
// https://vite.dev/config/
export default defineConfig({
// Use root-relative assets so LB rewrites to /index.html still load bundles from /.
base: "/",
optimizeDeps: {
exclude: ["@runmedev/renderers"],
},
plugins: [
react(),
tailwindcss(),
svgr({
// Copied options from UIKit
svgrOptions: {
// https://react-svgr.com/docs/options/#icon
icon: true,
ref: true,
},
}),
],
server: {
headers: {
// Set these if when we enable webcontainers
//"Cross-Origin-Opener-Policy": "same-origin",
//"Cross-Origin-Embedder-Policy": "require-corp",
//"Cross-Origin-Embedder-Policy": "credentialless",
},
watch: {
// Avoid full page reloads when local notebook fixtures are auto-saved.
// (These live under the Vite root so file writes would otherwise trigger
// a reload on every keystroke.)
ignored: ["**/test/fixtures/notebooks/**"],
},
},
preview: {
headers: {
//"Cross-Origin-Opener-Policy": "same-origin",
//"Cross-Origin-Embedder-Policy": "require-corp",
//"Cross-Origin-Embedder-Policy": "credentialless",
},
},
build: {
chunkSizeWarningLimit: 999999,
rollupOptions: {
output: {
manualChunks: undefined,
// Use hash in file names for cache busting. This ensures that when the user clicks
// refresh in the browser, if the server is serving a new version of the app the app
// will be reloaded since the file names will be different.
// This turns out to be much easier than trying to inject the git commit with bazel stamping.
// Its also ensures reproducible builds.
entryFileNames: `index.[hash].js`,
chunkFileNames: `index.[hash].js`,
assetFileNames: `[name].[hash].[ext]`,
},
},
},
test: {
// Run a shared setup to stub browser globals (e.g., window) for Node env tests.
setupFiles: ["./vitest.setup.ts"],
environment: "jsdom",
},
});