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

Add browser support #61

Merged
merged 10 commits into from
Mar 19, 2020
Merged

Conversation

Richienb
Copy link
Contributor

@Richienb Richienb commented Mar 12, 2020

Fixes #60

cc @sindresorhus

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@sindresorhus
Copy link
Owner

See https://nodejs.org/api/esm.html#esm_conditional_exports on how to add the browser version.

@Richienb
Copy link
Contributor Author

Richienb commented Mar 12, 2020

@sindresorhus Should I be concerned that browserify doesn't detect the browser version this way?

@sindresorhus
Copy link
Owner

We can have both the browser field and the conditional exports. I would recommend opening an issue on Browserify about supporting conditional exports though. That's the future.

@Richienb
Copy link
Contributor Author

@sindresorhus Done!

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb Richienb requested a review from sindresorhus March 14, 2020 07:07
@sindresorhus
Copy link
Owner

Since the browser version is just for modern browsers, we can just use ES2015 export syntax there.

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb
Copy link
Contributor Author

Fixed!

Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb
Copy link
Contributor Author

@sindresorhus Please re-review.

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

Successfully merging this pull request may close these issues.

Browser support?
2 participants