forked from martin-pabst/Online-IDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config-standalone.js
39 lines (35 loc) · 1.16 KB
/
vite.config-standalone.js
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
import { resolve, join } from 'path'
import { defineConfig } from 'vite'
import { readFileSync, renameSync } from 'fs';
import { fileURLToPath } from 'url';
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth() + 1; //Months are zero based
var curr_year = d.getFullYear();
var hour = d.getHours();
var minute = d.getMinutes();
var buildDate = curr_date + "." + curr_month + "." + curr_year + ", " + hour + ":" + minute + " Uhr";
export default defineConfig({
define: {
'APP_VERSION': JSON.stringify(pkg.version),
'BUILD_DATE': JSON.stringify(buildDate)
},
build: {
sourcemap: true,
rollupOptions: {
input: {
embedded: resolve(__dirname, 'standalone.html')
},
output: {
entryFileNames: assetInfo => 'online-ide-embedded.js',
assetFileNames: assetInfo => assetInfo.name.endsWith('css') ? 'online-ide-embedded.css' : 'assets/[name]-[hash][extname]',
manualChunks: {}
}
},
chunkSizeWarningLimit: 4912,
emptyOutDir: false
}
});