2 files changed +31
-22
lines changed Original file line number Diff line number Diff line change 49
49
< ul >
50
50
< li id ="infomenu "> Info...</ li >
51
51
< li >
52
- < a href ="https://rgbds.gbdev.io/docs/v0.9.1 " target ="_blank "> rgbds manual</ a >
52
+ <!-- This link is templated using the VITE_RGBDS_VERSION env variable, set at build time. See vite.config.js -->
53
+ < a href ="https://rgbds.gbdev.io/docs/%VITE_RGBDS_VERSION% " target ="_blank "> rgbds manual</ a >
53
54
</ li >
54
55
< li >
55
56
< a href ="https://github.com/gbdev/rgbds-live/issues " target ="_blank "> Report a problem</ a >
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from 'vite' ;
2
2
import { viteStaticCopy } from 'vite-plugin-static-copy' ;
3
+ import { execSync } from 'node:child_process' ;
3
4
4
- export default defineConfig ( {
5
- base : '/rgbds-live/' ,
6
- build : {
7
- target : [ 'chrome109' , 'safari15.6' , 'firefox102' ] ,
8
- outDir : 'www' ,
9
- chunkSizeWarningLimit : 1000 ,
10
- } ,
11
- resolve : {
12
- alias : {
13
- ace : 'ace-builds/src-noconflict/' ,
5
+ export default defineConfig ( ( { command, mode, isSsrBuild, isPreview } ) => {
6
+ // Extract the RGBDS version we're using and set it as an env variable
7
+ process . env . VITE_RGBDS_VERSION = execSync (
8
+ "git --git-dir=rgbds/.git -c safe.directory='*' describe --tags --always" ,
9
+ ) . toString ( 'utf8' ) ;
10
+ console . log ( "VITE_RGBDS_VERSION set to" , process . env . VITE_RGBDS_VERSION )
11
+ return {
12
+ base : '/rgbds-live/' ,
13
+ build : {
14
+ target : [ 'chrome109' , 'safari15.6' , 'firefox102' ] ,
15
+ outDir : 'www' ,
16
+ chunkSizeWarningLimit : 1000 ,
14
17
} ,
15
- } ,
16
- plugins : [
17
- viteStaticCopy ( {
18
- targets : [
19
- {
20
- src : './node_modules/ace-builds/src-noconflict/**' ,
21
- dest : 'assets/ace' ,
22
- } ,
23
- ] ,
24
- } ) ,
25
- ] ,
18
+ resolve : {
19
+ alias : {
20
+ ace : 'ace-builds/src-noconflict/' ,
21
+ } ,
22
+ } ,
23
+ plugins : [
24
+ viteStaticCopy ( {
25
+ targets : [
26
+ {
27
+ src : './node_modules/ace-builds/src-noconflict/**' ,
28
+ dest : 'assets/ace' ,
29
+ } ,
30
+ ] ,
31
+ } ) ,
32
+ ] ,
33
+ } ;
26
34
} ) ;
0 commit comments