fengari-interop
fengari-interop copied to clipboard
Import keyword in JS Lua module
Hello, I have noticed some JS package has been used the ESModule instead CommonJS. Its annoying since there's no built-in JS function in lua like js.import.
Does the team have a plan to add import keyword onto JS Lua module?
Sure, I think we'd accept a pull request adding a js.import() function that uses a dynamic import
Though note that dynamic import returns a promise, which are not currently handled automatically by fengari (see https://github.com/fengari-lua/fengari-interop/issues/2)
I think this would be EXTREMELY helpful. I might make a PR for this.