-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
72 lines (68 loc) · 1.75 KB
/
vite.config.ts
File metadata and controls
72 lines (68 loc) · 1.75 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
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import UnoCSS from "unocss/vite";
import path from "path";
import legacy from "@vitejs/plugin-legacy";
import { BaseURL } from "./src/constants/app.ts";
// https://vite.dev/config/
export default defineConfig({
"base" : BaseURL,
"esbuild": {
"supported": {
// for some reason, esbuild fails without this option
"destructuring": true,
},
},
"server": {
// expose to the network
"host": true,
},
"preview": {
// allow any origins in preview mode ("vite preview")
"allowedHosts": true,
},
// handles "@/..." imports
"resolve": {
"alias": {
"@": path.resolve(__dirname, "./src"),
},
},
"plugins": [
svelte(),
// uses unocss package
UnoCSS(),
/*
* Adds support for legacy browsers.
* If you don't want to support them, remove this plugin
* and "@vitejs/plugin-legacy" & "terser" packages
*/
legacy({
"targets": [
// default @vitejs/plugin-legacy browserlist
"edge>=79",
"firefox>=67",
/*
* 'AbortController' requires Chrome 66+
* default value: "chrome>=64"
*/
"chrome>=66",
"safari>=12",
/*
* 'AbortController' requires Chrome 66+
* default value: "chromeAndroid>=64"
*/
"chromeAndroid>=66",
"iOS>=12",
],
// add polyfills that weren't included in vite build
"modernPolyfills": [
"web.queue-microtask",
"es/global-this",
// introduced in Chrome 73+ and Firefox 63+
"es.object.from-entries",
// introduced in Chrome 85+ and Firefox 77+
"esnext.string.replace-all",
],
}),
],
});