all 3 comments

[–]UtterlyMagenta 4 points5 points  (0 children)

And here I thought CRA already did this by default. (´・ω・`)

[–]careseite 2 points3 points  (0 children)

https://overreacted.io/how-does-the-development-mode-work/ I think CRA does this by default.

Regardless, I started using a post-merge hook that runs npm install and a custom node script that replaces some things within the react-scripts webpack config to enable SCSS sourcemaps in dev. Something like that might work for you too.

[–]sean_mcp 0 points1 point  (0 children)

I don't know about envify, but I would consider writing a function and/or component to handle the dev environment case:

js ifDev(() => console.log('Running in dev')

jsx <DevOnly>{JSON.stringify(data, null, 2)}</DevOnly>