-
Notifications
You must be signed in to change notification settings - Fork 25
/
vite.config.js
45 lines (43 loc) · 972 Bytes
/
vite.config.js
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
import { resolve } from "path";
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { buildParserFile } from "@lezer/generator";
/** A simple custom Rollup-compatible plugin to import Lezer grammars. */
function lezer() {
return {
name: "rollup-plugin-lezer",
transform(src, id) {
if (/\.grammar$/.test(id)) {
return {
code: buildParserFile(src).parser,
map: null,
};
}
},
};
}
// https://vitejs.dev/config/
export default defineConfig({
build: {
target: "esnext",
chunkSizeWarningLimit: 1500,
},
resolve: {
alias: {
"@": resolve("src"),
},
},
plugins: [svelte(), lezer()],
optimizeDeps: {
entries: ["index.html", "src/**/*.{test,worker}.{js,ts}"],
exclude: ["percival-wasm"],
},
server: {
proxy: {
"/api": {
target: "http://localhost:3030",
changeOrigin: true,
},
},
},
});