forked from martin-pabst/SQL-IDE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config-common.ts
More file actions
43 lines (35 loc) · 1.22 KB
/
vite.config-common.ts
File metadata and controls
43 lines (35 loc) · 1.22 KB
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
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import type { UserConfig } from 'vite'
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);
const d = new Date();
const curr_date = d.getDate();
const curr_month = d.getMonth() + 1; //Months are zero based
const curr_year = d.getFullYear();
let hour = "" + d.getHours();
while(hour.length < 2) hour = "0" + hour;
let minute = "" + d.getMinutes();
while(minute.length < 2) minute = "0" + minute;
const buildDate = curr_date + "." + curr_month + "." + curr_year + ", " + hour + ":" + minute + " Uhr";
export default {
appType: 'mpa', // to serve 404 on "not found" (instead of erroneously serving index.html)
esbuild: {
logOverride: {
'unsupported-css-nesting': 'silent',
'unsupported-@namespace': 'silent',
},
dropLabels: ['DEBUG']
},
build: {
sourcemap: true,
emptyOutDir: true,
chunkSizeWarningLimit: 4912,
assetsInlineLimit: 10*1024
},
define: {
'APP_VERSION': JSON.stringify(pkg.version),
'BUILD_DATE': JSON.stringify(buildDate)
}
} satisfies UserConfig