generated from Chocobois/choco-jam-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
70 lines (66 loc) · 1.66 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 './automation/git-version';
import preImageOptimizer from './automation/pre-image-optimizer';
import neuBuild from './automation/neu-build';
import neuInject from './automation/neu-inject';
import bundleWinApp from './automation/win-bundle';
import bundleMacApp from './automation/mac-bundle';
import bundleLinuxApp from './automation/linux-bundle';
import buildCleanup from './automation/build-cleanup';
import { title, team, description, title_dashed } from './automation/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',
},
});
};