-
Notifications
You must be signed in to change notification settings - Fork 64
/
vite.config.mts
67 lines (65 loc) · 1.44 KB
/
vite.config.mts
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
import type { UserConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { visualizer } from "rollup-plugin-visualizer";
import preprocess from "svelte-preprocess";
import checker from "vite-plugin-checker";
import path from "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: {
include: ["@massif/lancer-data", "jszip" /* "axios" */], // machine-mind's cjs dependencies
},
build: {
outDir: path.resolve(__dirname, "dist"),
emptyOutDir: false,
sourcemap: true,
lib: {
name: "lancer",
entry: path.resolve(__dirname, "src/lancer.ts"),
formats: ["es"],
fileName: "lancer",
},
},
esbuild: {
minifyIdentifiers: false,
keepNames: true,
},
plugins: [
svelte({
preprocess: preprocess(),
}),
checker({
typescript: true,
// svelte: { root: __dirname },
}),
visualizer({
gzipSize: true,
template: "treemap",
}),
],
define: {
"process.env": process.env,
},
};
export default config;