-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvite.config.js
34 lines (33 loc) · 987 Bytes
/
vite.config.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
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { execSync } from 'node:child_process';
export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
// Extract the RGBDS version we're using and set it as an env variable
process.env.VITE_RGBDS_VERSION = execSync(
"git --git-dir=rgbds/.git -c safe.directory='*' describe --tags --always",
).toString('utf8');
console.log("VITE_RGBDS_VERSION set to", process.env.VITE_RGBDS_VERSION)
return {
base: '/rgbds-live/',
build: {
target: ['chrome109', 'safari15.6', 'firefox102'],
outDir: 'www',
chunkSizeWarningLimit: 1000,
},
resolve: {
alias: {
ace: 'ace-builds/src-noconflict/',
},
},
plugins: [
viteStaticCopy({
targets: [
{
src: './node_modules/ace-builds/src-noconflict/**',
dest: 'assets/ace',
},
],
}),
],
};
});