-
Notifications
You must be signed in to change notification settings - Fork 360
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
Isomorphic imports 2 #27
Isomorphic imports 2 #27
Conversation
Isomorphic imports
… into isomorphic-imports-2
@@ -0,0 +1,5 @@ | |||
module.exports = { | |||
idb: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idb
is a function here, but in the browser version it's an object with two methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating
This looks good to me! Going to bump the main version for this in case it breaks things with particular importers. |
This has caused #33 - not all node.js environments should reject idb - Electron, Atom and anything else with access to a browser window should have a specific check. |
specify main and browser fields in package.json
https://github.com/defunctzombie/package-browser-field-spec/blob/master/README.md
main exports function that returns undefined
browser exports idb
alternative to this pull request: #18
and fixes this issue: #17
You can test in this project:
https://github.com/noahehall/react-f-your-starterkit
$ npm install
$ npm run dev > test on 127.0.0.1:3000
$ npm run prod > test on https://localhost:3000