-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts.js
102 lines (102 loc) · 11.6 KB
/
vite.config.ts.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
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
92
93
94
95
96
97
98
99
100
101
102
// vite.config.ts
import * as path from "node:path";
import "node:fs/promises";
import "node:fs";
import browserslist from "browserslist";
import { platform } from "node:os";
import { readFileSync } from "node:fs";
import { sveltekit } from "@sveltejs/kit/vite";
function browserslistToEsbuild(browserslistConfig) {
if (!browserslistConfig) {
const path2 = process.cwd();
browserslistConfig = browserslist.loadConfig({ path: path2 });
}
const SUPPORTED_ESBUILD_TARGETS = ["es", "chrome", "edge", "firefox", "ios", "node", "safari"];
const replaces = {
ios_saf: "ios",
android: "chrome"
};
const SEPERATOR = " ";
return browserslist(browserslistConfig).map((b) => b.split(SEPERATOR)).map((b) => {
b[0] = replaces[b[0]] ? replaces[b[0]] : b[0];
return b;
}).map((b) => {
if (b[1].includes("-")) {
b[1] = b[1].slice(0, b[1].indexOf("-"));
}
return b;
}).map((b) => {
if (b[1].endsWith(".0")) {
b[1] = b[1].slice(0, -2);
}
return b;
}).filter((b) => SUPPORTED_ESBUILD_TARGETS.includes(b[0])).reduce((acc, b) => {
const existingIndex = acc.findIndex((br) => br[0] === b[0]);
if (existingIndex !== -1) {
acc[existingIndex][1] = b[1];
} else {
acc.push(b);
}
return acc;
}, []).map((b) => b.join(""));
}
var pkg = JSON.parse(readFileSync("./package.json", {
encoding: "utf-8"
}));
function createViteConfig() {
const browserslist2 = browserslistToEsbuild("last 5 major versions and >= 0.1% and supports es6-module and supports es6-module-dynamic-import");
return {
plugins: [sveltekit()],
build: {
target: browserslist2,
minify: "terser",
terserOptions: {
ecma: 2015,
module: true,
compress: {
keep_fargs: false
},
format: {
comments: false
}
},
rollupOptions: {
plugins: []
}
},
optimizeDeps: {},
ssr: {},
esbuild: {
legalComments: "none"
},
server: {
https: {
cert: readFileSync(platform() === "linux" ? "./config/app-cert.windows.pem" : "./config/example.com+5.pem"),
key: readFileSync(platform() === "linux" ? "./config/app-key.windows.pem" : "./config/example.com+5-key.pem")
},
host: true
},
css: {
preprocessorOptions: {
scss: {}
}
},
resolve: {
alias: {
types: path.resolve("./src/lib/types"),
$pages: path.resolve("./src/pages/"),
$loaders: path.resolve("./src/routes/_loaders"),
$i18n: path.resolve("./src/i18n"),
$utils: path.resolve("./src/lib/utils"),
$components: path.resolve("./src/lib/components"),
$firebase: path.resolve("./src/lib/utils/firebase.ts"),
$stores: path.resolve("./src/lib/stores")
}
}
};
}
var vite_config_default = createViteConfig();
export {
vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCAqIGFzIHBhdGggZnJvbSAnbm9kZTpwYXRoJztcbmltcG9ydCAqIGFzIGZzIGZyb20gJ25vZGU6ZnMvcHJvbWlzZXMnO1xuaW1wb3J0ICogYXMgZnNTeW5jIGZyb20gJ25vZGU6ZnMnO1xuaW1wb3J0IGJyb3dzZXJzbGlzdCBmcm9tICdicm93c2Vyc2xpc3QnO1xuXG5pbXBvcnQgeyBwbGF0Zm9ybSB9IGZyb20gJ25vZGU6b3MnO1xuaW1wb3J0IHsgZnN0YXQsIHJlYWRGaWxlU3luYyB9IGZyb20gJ25vZGU6ZnMnO1xuaW1wb3J0IHsgc3ZlbHRla2l0IH0gZnJvbSAnQHN2ZWx0ZWpzL2tpdC92aXRlJztcbi8vIGltcG9ydCB7IHR5cGVzYWZlSTE4blBsdWdpbiB9IGZyb20gJ3R5cGVzYWZlLWkxOG4vcm9sbHVwL3JvbGx1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