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

Expose different module specs #78

Open
gmarty opened this issue Jul 19, 2016 · 1 comment
Open

Expose different module specs #78

gmarty opened this issue Jul 19, 2016 · 1 comment

Comments

@gmarty
Copy link

gmarty commented Jul 19, 2016

Currently the code is only exposed as a commonjs module which makes sense on Node, but is not optimal on the browser.
That'd be great to expose it under different module specs too. Something like UMD can be used to increase compatibility and support more environments.

@camertron
Copy link
Collaborator

Hey @gmarty, you should be able to use twitter-cldr-js (or probably more likely twitter-cldr-npm) in the browser without too much trouble. We expose a commonjs module if module.exports is defined, otherwise we define a top-level object called TwitterCLDR on this, which is window in the browser. Could you explain why such an approach is not optimal? Is the concern adding something to the global namespace? What would you suggest to improve things?

I'd happily accept a pull request adding support for other module specs such as the ones described in UMD. Viva la open source.

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