Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to import es5 / es6 modules? #8

Closed
gforceg opened this issue Feb 2, 2020 · 2 comments
Closed

is it possible to import es5 / es6 modules? #8

gforceg opened this issue Feb 2, 2020 · 2 comments

Comments

@gforceg
Copy link

gforceg commented Feb 2, 2020

I tried to import typescript / javascript modules but it doesn't seem to like the module format I'm using.

godot generates an error:

E 0:00:00.514   reload: JavaScript Error    at <anonymous> (res://node_modules/of-range/range.js:2)
exports is not defined
  <C++ Source>  modules/ECMAScript/ecmascript.cpp:90 @ reload()

I have tried both node_modules and and files within my project directory. I think a way around this problem would be to use a bundler such-as webpack but I am hoping there is a simpler way to make this work.

@Geequlim
Copy link
Collaborator

Geequlim commented Feb 2, 2020

You can only using standard ES6 modules format.

@gforceg
Copy link
Author

gforceg commented Feb 2, 2020

Thanks! I thought I had tried ES6 but I was wrong. It's working now.

@gforceg gforceg closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants