Hi there, I'm facing a problem on deployment with creat-react-app: my src files are expose, how can I remove them from statics without eject?
My source tree

This looks like the development environment, which is expected. This shouldn't happen in production.
This happens here too, but if I remove the map files, everything's fine. I know that source maps are helpful for debuggers and browsers, but are they really necessary in production? If the answer is yes, how could we also keep them but avoid having the files exposed?
Using node 9.3.0 and express with nodemon.
You can add a postbuild script in package.json that moves the files to a different directory or deletes them.
If you want to remove sourcemaps you can do it like this.
https://github.com/facebook/create-react-app/issues/1341#issuecomment-270108407
Note that this doesn't "protect" your code. Any code shipped to the client can be inspected and reverse engineered, regardless of whether it's minified or not.
@gaearon I believe the aim here is not to prevent reverse engineering but rather make it harder to do so. Any code can be reverse engineered the question is how easy you want it to be.
Most helpful comment
This happens here too, but if I remove the map files, everything's fine. I know that source maps are helpful for debuggers and browsers, but are they really necessary in production? If the answer is yes, how could we also keep them but avoid having the files exposed?
Using node 9.3.0 and express with nodemon.