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

Don't export dom module if on node #14

Open
sohkai opened this issue Jun 22, 2016 · 1 comment
Open

Don't export dom module if on node #14

sohkai opened this issue Jun 22, 2016 · 1 comment
Assignees

Comments

@sohkai
Copy link
Contributor

sohkai commented Jun 22, 2016

Would be nice to only export the dom module if the user's targeting the browser, similar to how fetch-ponyfill and others do it.

Currently, including the entire package through require('js-utility-belt') on node results in errors because node doesn't have window or document.

From the looks of it, this should be easily done by using the package.json's browser field for lib/index.js and changing the main field for a lib/node.js that strips away the dom export.

@sohkai sohkai self-assigned this Jun 22, 2016
@sohkai
Copy link
Contributor Author

sohkai commented Jun 24, 2016

See webpack/webpack#1122 for some ideas for webpack building.

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

1 participant