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

seems to incorrectly detect webpack build as node env (instead of browser) #336

Closed
quinn opened this issue Nov 20, 2016 · 2 comments
Closed

Comments

@quinn
Copy link

quinn commented Nov 20, 2016

this code:

if (typeof process !== 'undefined' && process.type === 'renderer') {
  module.exports = require('./browser.js');
} else {
  module.exports = require('./node.js');
}

seems to choose to module.exports = require('./node.js') inside of a webpack build being built for the browser (even in dev mode, without using the define plugin)

@TooTallNate
Copy link
Contributor

Something about your webpack config is making it not respect the browser field in the package.json file (similar to #328). This happens by default.

@quinn
Copy link
Author

quinn commented Nov 21, 2016

thanks, that helped me figure this out. I had '/index.js' in the list for module.extensions which prevented webpack from checking the package.json

@quinn quinn closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants