Skip to content

How to implement require() #2007

Answered by U-100
U-100 asked this question in Q&A
Nov 24, 2024 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

ok, I got around this problem by doing:

ObjectInstance module = engine.Modules.Import(team.scriptFile);
JsValue tickFunction = module.Get("tick");
engine.Invoke(tickFunction);

and now import { name } from "./mymodule.js"; works as expected in JavaScript

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@U-100
Comment options

@U-100
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by U-100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants