Closed marzipankaiser closed 2 months ago
Motivation: If you compile some Effekt file like main.effekt
on the JS backend using effekt --build --backend js main.effekt
, the resulting file out/main
is just a thin wrapper containing the following:
#!/usr/bin/env node
require('/a/long/path/to/./out/main.js').main()
Unfortunately, this prevents any attempts at packaging the resulting application in a reasonable way since the path is absolute.
Instead, it should perhaps be a relative path like require('./main.js').main()
and we then trust the packager to bundle the runner script together with the JS file.
Currently errors out on Windows with:
Error: Cannot find module './D:\a\effekt\effekt\out\tests\effekt.javascripttests\sideeffects.js'
Require stack:
- D:\a\effekt\effekt\out\tests\effekt.javascripttests\sideeffects__main.js
[...]
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\a\\effekt\\effekt\\out\\tests\\effekt.javascripttests\\sideeffects__main.js'
]
}
We also might want to check what happens on the Chez backends wrt this issue 👀
Currently, the generated script for loading the compiled JavaScript uses an absolute path. This prevents moving the generated files.
This makes it so a relative path is used instead.