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

Fix webpack.defineplugin use #37

Open
sibnerian opened this issue Feb 2, 2018 · 2 comments
Open

Fix webpack.defineplugin use #37

sibnerian opened this issue Feb 2, 2018 · 2 comments

Comments

@sibnerian
Copy link

First off: love the project. It's the best integration I've seen of the various techs at the bleeding-edge of frontend dev - and I've seen a few!

Just wanted to flag the use of definePlugin in the sample webpack configs. It's not recommended to redefine the whole process.env variable, but rather just the variables that you care about (in this case process.env.NODE_ENV). See: https://webpack.js.org/plugins/define-plugin/#feature-flags.

I got burned by this in production a bit ago for a project based on this demo boilerplate -- I tore my hair out for a while wondering why process.env wasn't the same in my server index and my server-side code. I figured I'd save some other folks some time if they're doing the same!

@faceyspacey
Copy link
Owner

thanks brother! ...feel free to PR

@sibnerian
Copy link
Author

sibnerian commented Feb 7, 2018 via email

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