-
Notifications
You must be signed in to change notification settings - Fork 57
/
vite.config.ts
66 lines (64 loc) · 1.54 KB
/
vite.config.ts
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
import type { UserConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { visualizer } from "rollup-plugin-visualizer";
import checker from "vite-plugin-checker";
const path = require("path");
const config: UserConfig = {
root: "src/",
base: "/systems/lancer/",
publicDir: path.resolve(__dirname, "public"),
server: {
port: 30001,
open: true,
proxy: {
"^(?!/systems/lancer)": "http://localhost:30000/",
"/socket.io": {
target: "ws://localhost:30000",
ws: true,
},
},
},
resolve: {
alias: [
{
find: "./runtimeConfig",
replacement: "./runtimeConfig.browser",
},
],
},
optimizeDeps: {
exclude: ["machine-mind"], // machine-mind triggers https://github.com/evanw/esbuild/issues/1433
include: ["lancer-data", "jszip", "axios", "readonly-proxy"], // machine-mind's cjs dependencies
},
build: {
outDir: path.resolve(__dirname, "dist"),
emptyOutDir: true,
sourcemap: true,
brotliSize: true,
terserOptions: {
mangle: false,
keep_classnames: true,
keep_fnames: true,
},
lib: {
name: "lancer",
entry: path.resolve(__dirname, "src/lancer.ts"),
formats: ["es"],
fileName: "lancer",
},
},
plugins: [
svelte({
configFile: "../svelte.config.cjs", // relative to src/
}),
checker({
typescript: true,
// svelte: { root: __dirname },
}),
visualizer({
gzipSize: true,
template: "treemap",
}),
],
};
export default config;