You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that while developing the transpiled code that the dev is working with may be fundamentally different than the one that will end up being pushed to production.
I ran into a problem, where a library was working correctly, but when transpiled for an older browser the resulting code threw an error immediatelly. While this is a problem on the library side, the fact that everything worked with npm start (development build) but did not work with npm run build (production build) lead to a completely broken production + a hard to find bug, since it only happened in production build.
Is there any reason what so every to compile the source code differently in development and in production? I cannot come up with any situation where this would be advantagious.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TLDR
"production"
and"development"
browsers should always be the same and there is no reason for them not to be.Full Question
When creating an App with CRA, the generated
package.json
(link for generated package json) contains these fields:This means that while developing the transpiled code that the dev is working with may be fundamentally different than the one that will end up being pushed to production.
I ran into a problem, where a library was working correctly, but when transpiled for an older browser the resulting code threw an error immediatelly. While this is a problem on the library side, the fact that everything worked with
npm start
(development build) but did not work withnpm run build
(production build) lead to a completely broken production + a hard to find bug, since it only happened in production build.Is there any reason what so every to compile the source code differently in development and in production? I cannot come up with any situation where this would be advantagious.
Beta Was this translation helpful? Give feedback.
All reactions