Different browser compatibility per environment #13477
Unanswered
DaveVodrazka
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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