Skip to content

Commit 71d39b1

Browse files
committed
Build with ENVIRONMENT=node,web, so that the .wasm doesn't have to be manually loaded
1 parent ba9b1f4 commit 71d39b1

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
needs: build
2222
strategy:
2323
matrix:
24-
node: [20, 22]
24+
node: [20, 22, 23]
2525
name: test (Node v${{ matrix.node }})
2626
runs-on: ubuntu-latest
2727
steps:

bin/emglken.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ https://github.com/curiousdannii/emglken
1111
1212
*/
1313

14-
import fs from 'fs'
15-
1614
import minimist from 'minimist'
1715

1816
import {CheapAsyncDialog, CheapGlkOte, RemGlk} from '../build/asyncglk.js'
@@ -87,7 +85,6 @@ async function run()
8785
Dialog,
8886
GlkOte,
8987
}
90-
const wasmBinary = fs.readFileSync(new URL(`../build/${format.id}.wasm`, import.meta.url))
9188

9289
process.on('unhandledRejection', error => {
9390
if (error.name !== 'ExitStatus' || error.message !== 'Program terminated with exit(0)') {
@@ -97,9 +94,7 @@ async function run()
9794
})
9895

9996
const engine = (await import(`../build/${format.id}.js`)).default
100-
const vm = await engine({
101-
wasmBinary,
102-
})
97+
const vm = await engine()
10398
vm.start(options)
10499
}
105100

src/common.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function(emglken_vm target)
3434
# Output options
3535
--minify 0
3636
--profiling-funcs
37-
-sENVIRONMENT=web
37+
-sENVIRONMENT=node,web
3838
-sEXPORT_ES6=1
3939
-sMODULARIZE=1
4040
# Optimisations

src/preamble.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ function accept(data) {
4747

4848
// And now some things just to patch over Emscripten's lack of a none environment. These could probably be removed if https://github.com/emscripten-core/emscripten/issues/12184 ever gets implemented
4949
// Add an importScripts function to prevent an assertion error
50-
function importScripts() {}
50+
//function importScripts() {}
5151
// Fake locateFile so that Lectrote doesn't get tripped up on import.meta.url not being handled in CJS properly
52-
Module['locateFile'] = function() {}
52+
//Module['locateFile'] = function() {}

0 commit comments

Comments
 (0)