Skip to content

Instantly share code, notes, and snippets.

@lukaslihotzki
lukaslihotzki / sea-config.json
Last active November 24, 2023 17:24
Embed binary files into Node SEA by reading them into the snapshot
{
"main": "server-with-assets.js",
"output": "sea-prep.blob",
"useSnapshot": true,
"codeCache": true
}
@lukaslihotzki
lukaslihotzki / polyfill_worklet_import.js
Last active October 1, 2022 14:02
Polyfill to support "import" in worklet scripts in Firefox
const wrappedFunc = Worklet.prototype.addModule;
Worklet.prototype.addModule = async function(url) {
try {
return await wrappedFunc.call(this, url);
} catch (e) {
if (e.name != 'AbortError') {
throw e;
}
// assume error is caused by https://bugzilla.mozilla.org/show_bug.cgi?id=1572644