Why are the source code and node_modules served ?
I use CRA ([email protected]). If I serve my app locally, so using webpack devserver, I have the expected files served.
However, if I serve my build folder, with a npm run build, followed by a serve -s build, I have the following files served :
- static/
- css/
- js /
- media/
- node_modules/
- path/to/my/local/source/code
- node_modules
- src
My build folder is at the root, and contains all the files and folders I am expecting to see.
BTW, I use firebase hosting to deploy my app. And I see the same file structure in my deployed app.
Any clue what I'm missing here ?
@harvey56 I'm having the same issue too. Did you manage to solve the issue?
EDIT: I just managed to solve this. You just have to add GENERATE_SOURCEMAP=false in your .env file (it is only used in production)
Oops! sorry for the late reply @hielfx
Yes, that's what I do. I added GENERATE_SOURCEMAP=false in my script in my package.json file.