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

Feature Request: provide ESM conform dist target #40

Closed
merryman opened this issue Oct 19, 2020 · 3 comments
Closed

Feature Request: provide ESM conform dist target #40

merryman opened this issue Oct 19, 2020 · 3 comments

Comments

@merryman
Copy link
Contributor

merryman commented Oct 19, 2020

I noticed this while I was trying to import danfojs via the https://jspm.dev cdn.
Right now the distributed script of danfos expects itself to be executed globally.
That is all fine and dandy as long as you either include the script tag directly into the dom or load the script manually in the browser. However it kind of causes problems when you want to use danfojs in the context of an ES-Module based build system.
Since every declared variable inside a ES-Module is local to that module, the dfd var is not exposed and can also not be accessed via the global window (since danfojs is run in its own context).
Is it possible to add an additional target in the webpack bundle that provides an esm conform export of the dfd variable?
I think that should do the job.

Thank you for the hard work!

@merryman merryman changed the title Feature Request: User CommonJS conform population of global namespace Feature Request: provide ESM conform dist target Oct 19, 2020
@risenW
Copy link
Member

risenW commented Oct 20, 2020

@merryman Thanks for pointing this out. I'll look into it. Meanwhile, if you have any pointers, or fix for it please don't hesitate to add it.
Webpack config can be a pain most times 😄

@merryman
Copy link
Contributor Author

I added a quick fix in #42

@risenW
Copy link
Member

risenW commented Oct 21, 2020

Thanks, merged!

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