Skip to content

Commit 3dc8086

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

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

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

+1-1
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

+1-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ async function run()
8787
Dialog,
8888
GlkOte,
8989
}
90-
const wasmBinary = fs.readFileSync(new URL(`../build/${format.id}.wasm`, import.meta.url))
9190

9291
process.on('unhandledRejection', error => {
9392
if (error.name !== 'ExitStatus' || error.message !== 'Program terminated with exit(0)') {
@@ -97,9 +96,7 @@ async function run()
9796
})
9897

9998
const engine = (await import(`../build/${format.id}.js`)).default
100-
const vm = await engine({
101-
wasmBinary,
102-
})
99+
const vm = await engine()
103100
vm.start(options)
104101
}
105102

src/common.cmake

+1-1
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

+2-2
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)