faceyspacey / redux-first-router-demo

Kick-Ass Universal RFR Demo That Answers Your SSR + Splitting Questions
MIT License
125 stars 46 forks source link

Fix webpack.defineplugin use #37

Open sibnerian opened 6 years ago

sibnerian commented 6 years ago

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 commented 6 years ago

thanks brother! ...feel free to PR

sibnerian commented 6 years ago

Will do when I get a sec. Startup life! On Tue, Feb 6, 2018 at 9:12 PM James Gillmore notifications@github.com wrote:

thanks brother! ...feel free to PR

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/faceyspacey/redux-first-router-demo/issues/37#issuecomment-363632692, or mute the thread https://github.com/notifications/unsubscribe-auth/AC2wxJU3VQuDVvApbQSPTOkIs3aIa85Gks5tSQZ2gaJpZM4R37gJ .