hgoebl / mobile-detect.js

Device detection (phone, tablet, desktop, mobile grade, os, versions)
http://hgoebl.github.io/mobile-detect.js/
MIT License
4.12k stars 892 forks source link

ES6 module support #80

Open kkimdev opened 6 years ago

kkimdev commented 6 years ago

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

hgoebl commented 6 years ago

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

serbanghita commented 6 years ago

@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 commented 6 years ago

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

Zielak commented 6 years ago

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:

Should I create new issue?

kkimdev commented 6 years ago

@Zielak this issue is for that :)

DrNiels commented 6 years ago

+1, ES6 import would be nice

d3ividi commented 5 years ago

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

Thank you!

hgoebl commented 5 years ago

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.