-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
vite.config.js
64 lines (57 loc) · 1.63 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import sveltePreprocess from "svelte-preprocess";
import autoprefixer from "autoprefixer";
import path from "path";
//import { visualizer } from "rollup-plugin-visualizer";
export default defineConfig({
base: "", // relative paths
// allow using javascript-ampache locally for testing
server: {
fs: {
allow: [".."],
},
},
resolve: {
alias: {
"~": path.resolve("./src"),
},
},
plugins: [
svelte({
hot: {
preserveLocalState: true,
},
preprocess: sveltePreprocess({
sourceMap: false,
postcss: {
plugins: [autoprefixer()],
},
}),
onwarn: (warning, handler) => {
// handled within shoelace components
if (warning.code === "a11y-no-static-element-interactions")
return;
// handled within shoelace components
if (warning.code === "a11y-click-events-have-key-events")
return;
// proceed with other warnings normally
handler(warning);
},
}),
// visualizer({
// open: true,
// }),
],
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
},
});