-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
70 lines (66 loc) · 1.78 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
67
68
69
70
import { defineConfig } from "vite";
import zip from "vite-plugin-zip-pack";
import checker from "vite-plugin-checker";
import tsconfigPaths from "vite-tsconfig-paths";
import getGitVersion from "./scripts/git-version";
import preImageOptimizer from "./scripts/pre-image-optimizer";
import neuBuild from "./scripts/neu-build";
import neuInject from "./scripts/neu-inject";
import bundleWinApp from "./scripts/win-bundle";
import bundleMacApp from "./scripts/mac-bundle";
import bundleLinuxApp from "./scripts/linux-bundle";
import buildCleanup from "./scripts/build-cleanup";
import { title, team, description, title_dashed } from "./scripts/constants";
export default () => {
process.env.VITE_GAME_TITLE = title;
process.env.VITE_GAME_TEAM = team;
process.env.VITE_GAME_DESCRIPTION = description;
return defineConfig({
base: "./",
root: "src",
plugins: [
tsconfigPaths(),
getGitVersion(),
checker({
typescript: true,
}),
preImageOptimizer(),
neuInject(),
neuBuild(),
bundleWinApp(),
bundleMacApp(),
bundleLinuxApp(),
zip({
inDir: "./dist/web",
outDir: "./dist",
outFileName: `${title_dashed}-web.zip`,
}),
zip({
inDir: `./dist/win`,
outDir: "./dist",
outFileName: `${title_dashed}-win.zip`,
}),
zip({
inDir: `./dist/linux`,
outDir: "./dist",
outFileName: `${title_dashed}-linux.zip`,
}),
buildCleanup(),
],
build: {
outDir: "../dist/web",
chunkSizeWarningLimit: 4096,
assetsInlineLimit: 0,
target: "ES2022",
minify: "terser",
terserOptions: {
format: {
comments: false,
},
},
},
server: {
host: "localhost",
},
});
};