Skip to content

Commit

Permalink
Try to fix single-file mode
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Dec 12, 2024
1 parent 71d39b1 commit 6548670
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/preamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ function accept(data) {
// Log output
//Module['print'] = console.log

// 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
// Add an importScripts function to prevent an assertion error
//function importScripts() {}
// Fake locateFile so that Lectrote doesn't get tripped up on import.meta.url not being handled in CJS properly
//Module['locateFile'] = function() {}
// In single-file mode new URL constructor won't work
Module['locateFile'] = function(filename) {
try {
return new URL(filename, import.meta.url).href;

Check failure on line 51 in src/preamble.js

View workflow job for this annotation

GitHub Actions / test (Node v20)

Extra semicolon

Check failure on line 51 in src/preamble.js

View workflow job for this annotation

GitHub Actions / test (Node v23)

Extra semicolon
}
catch {
return filename
}
}

0 comments on commit 6548670

Please sign in to comment.