Enhance ScriptManager to allow CommonJS module support in JavaScript context
All checks were successful
Build JStom / build (push) Successful in 1m59s

This commit is contained in:
2026-01-28 21:09:30 +00:00
parent f9227e2128
commit c01026b7c1

View File

@@ -41,6 +41,9 @@ public class ScriptManager {
.allowHostAccess(HostAccess.ALL) .allowHostAccess(HostAccess.ALL)
.allowHostClassLookup(s -> true) .allowHostClassLookup(s -> true)
.allowIO(true) .allowIO(true)
.allowExperimentalOptions(true)
.option("js.commonjs-require", "true")
.option("js.commonjs-require-cwd", scriptsDir.getAbsolutePath())
.build(); .build();
context.getBindings("js").putMember("server", api); context.getBindings("js").putMember("server", api);