Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
avivace committed Feb 14, 2025
1 parent 7c4fadc commit cce158b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
4 changes: 0 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set -eu

test -d binjgb/out || ./build-binjgb.sh
test -f rgbds/rgbasm.wasm || ./build-rgbds.sh

#store rgbds version tag for use in vite build
export VITE_RGBDS_VERSION=$(git --git-dir=rgbds/.git -c safe.directory='*' describe --tags --always)

npm ci
npm run build

1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<ul>
<li id="infomenu">Info...</li>
<li>
<!-- This link is templated using the VITE_RGBDS_VERSION env variable, set at build time. See vite.config.js -->
<a href="https://rgbds.gbdev.io/docs/%VITE_RGBDS_VERSION%" target="_blank">rgbds manual</a>
</li>
<li>
Expand Down
49 changes: 28 additions & 21 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { execSync } from 'node:child_process';

export default defineConfig({
base: '/rgbds-live/',
build: {
target: ['chrome109', 'safari15.6', 'firefox102'],
outDir: 'www',
chunkSizeWarningLimit: 1000,
},
resolve: {
alias: {
ace: 'ace-builds/src-noconflict/',
export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
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,
},
},
plugins: [
viteStaticCopy({
targets: [
{
src: './node_modules/ace-builds/src-noconflict/**',
dest: 'assets/ace',
},
],
}),
],
resolve: {
alias: {
ace: 'ace-builds/src-noconflict/',
},
},
plugins: [
viteStaticCopy({
targets: [
{
src: './node_modules/ace-builds/src-noconflict/**',
dest: 'assets/ace',
},
],
}),
],
};
});

0 comments on commit cce158b

Please sign in to comment.