-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Not transpiling in prod mode? #1788
Comments
You are most likely importing files outside of appSrc (#1234) -- this is not allowed default behavior. |
Okay, but I have been doing it without errors before, is it a new bug? Does this mean I need to move svgs into my src folder? |
I'm only importing JavaScript from within |
My apologies, it actually looks like you're depending on a node module Node modules are not compiled -- you can change this behavior but I advise against it (same line, include node_modules). |
Interesting but why would it transpile in dev mode? This was the |
So you're saying I may need to include |
It's not being compiled in dev mode. |
Including |
Okay yeah you're right. Where should I put that line? |
Switch webpack.config.prod.js#171 to something like: include: [paths.appSrc, require.resolve('get-own-enumerable-property-symbols')], Your mileage may vary though. 😄 |
Okay I got the same error on a different line and |
And mileage at compile time or runtime ? |
Messed up your app in what way? (this is why you shouldn't compile Mileage as in the location of that line. |
I agree I wouldn't publish something not transpiled. It's bizarre the text of my app changed and it's still working fine in dev mode |
What do you suggest? |
I believe you're just seeing the effects of the minifier mangling names. You can tune UglifyJsPlugin to shut that off ( |
Would the require.resolve have anything to do with it mangling source code? Do I have to sacrifice mangling names? Btw I realize transpiling node_modules may be out of scope for create-react-app and appreciate your help |
No, the require.resolve is for something else. You might be able to tell uglify to ignore certain names, but that's out of the scope of my knowledge. |
Oh okay I get it now, it's resolving the pathname to require it. Okay I will try the mangle: false |
And yes that's what it's doing I didn't realize the package I'm using to convert JSX to string wasn't transpiled |
That fixed it thanks! |
I'm getting the following error when bundling in prod mode.
I searched for the error online and couldn't find anything, so then I looked at the code on the line referenced in the error and it was the following.
Does anyone know why it may not transpile? I ejected my config but haven't made any changes to the prod config besides adding a sass loader and excluding it from the url-loader. The app runs fine in dev mode
The text was updated successfully, but these errors were encountered: