You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a script registry, I'm using a loading function through require.WithLoader() to manually load the script and return the []byte, which works fine:
However, if the module is requested through a relative path from the script, which is in a subdirectory (e.g. something like const Actions = require("../libraries/Actions.mjs");), then I need to know where the requesting script is loading it from.
Would it be possible to make require.SourceLoader take the requesting script's path as well as the module path?
The text was updated successfully, but these errors were encountered:
The require module from goja_nodejs resolves module paths relative to the path of the currently running script. In order to make it work you need to make sure that the initial script receives the full path. Depending on how you run this initial script, you need either to pass the full path to RunScript() or to RequireModule.Require().
Hello~
When I create a script registry, I'm using a loading function through
require.WithLoader()
to manually load the script and return the []byte, which works fine:However, if the module is requested through a relative path from the script, which is in a subdirectory (e.g. something like
const Actions = require("../libraries/Actions.mjs");
), then I need to know where the requesting script is loading it from.Would it be possible to make
require.SourceLoader
take the requesting script's path as well as the module path?The text was updated successfully, but these errors were encountered: