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

[Q] Transpiling to ES5 for browser compability #16

Closed
andys8 opened this issue Mar 20, 2017 · 7 comments
Closed

[Q] Transpiling to ES5 for browser compability #16

andys8 opened this issue Mar 20, 2017 · 7 comments

Comments

@andys8
Copy link

andys8 commented Mar 20, 2017

Hi @sindresorhus, I'm wondering why this library is using ES6 and is not transpiling to ES5. Isn't that the common behavior nowadays? Is it intentional not to do it?

@SamVerschueren
Copy link

We aim for Node.js, not the browser. You can find a more detailed explanation here sindresorhus/ama#446

@andys8
Copy link
Author

andys8 commented Mar 20, 2017

Thanks for the quick answer. Do you think the description text could be misleading?

image

@SamVerschueren
Copy link

Okay, didn't check the repository to be honest before I answered. But there is a browser.js file so make sure to use that one.

@silverwind
Copy link
Collaborator

Not sure what your setup is, but you could use something like https://github.com/babel/babelify to browserify and transpile it to ES5.

@andys8
Copy link
Author

andys8 commented Mar 20, 2017

I'm using webpack and will transpile the library to es5 using Babel (or replace it). But because this is the first time I had to do this for a npm dependency, I wanted to ask you about it. Correct me if I'm wrong, but I think it's not common. But I see the point that this library is targeting nodejs. So thanks for your support.

@silverwind
Copy link
Collaborator

I think @sindresorhus expects the user to transpile, but I could be wrong.

@SamVerschueren
Copy link

It's all in the AMA question I linked to in my first reply.

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

3 participants