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

ES6 module support #80

Open
kkimdev opened this issue Mar 1, 2018 · 8 comments
Open

ES6 module support #80

kkimdev opened this issue Mar 1, 2018 · 8 comments

Comments

@kkimdev
Copy link

kkimdev commented Mar 1, 2018

It would be great if mobile-detect supports ES6 module style :)

@hgoebl
Copy link
Owner

hgoebl commented Mar 1, 2018

Yes, indeed. Currently, I have not enough time for this.
PR welcome.

@serbanghita
Copy link
Collaborator

@hgoebl I'm going to give this a try, I have an idea how to simplify the code and the import process overall. I'll try on a different branch and maybe discuss it separately based on the PR.

@kkimdev
Copy link
Author

kkimdev commented Mar 8, 2018

@serbanghita I guess a natural way to do is that feature-detect if browser supports es6 module, then export if so?

@Zielak
Copy link

Zielak commented Jun 20, 2018

I'm not quite sure what exactly is this issue about. I came here to report thats it's hard to import it in my ES6 JS/TS project. I'm transpiling it to ES5 anyway, so I don't mind browser-side module support.

My issue is that it's:

  • impossible to import and access via import MobileDetect from 'mobile-detect', my error tells me that 'mobile-detect' doesn't have default exports
  • mobile-detect gets itself to the global scope automatically and we can't contain it in our project with simple way. We want to avoid global scope pollution.

Should I create new issue?

@kkimdev
Copy link
Author

kkimdev commented Jun 20, 2018

@Zielak this issue is for that :)

@DrNiels
Copy link

DrNiels commented Oct 22, 2018

+1, ES6 import would be nice

@d3ividi
Copy link

d3ividi commented Jun 27, 2019

Hello, please know to tell me if it already works with ES6, otherwise what a way to do!

Thank you!

@hgoebl
Copy link
Owner

hgoebl commented Jun 27, 2019

Everybody is welcome to create a PR.
Please keep in mind that the code is generated and the template is the thing which should carry the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants