This website is bootstrapped using create-react-app. A production-ready minified and bundled code is generated in the build folder when the npm run build is run.
I have also specified the Publishing directory as build. But when I inspected the source of my website I found the node_modules folder and the original code I wrote (Not bundled code). Please help me with this? What am I doing wrong?
Thanks for replying. This is not the problem, the build folder will contain only the optimised bundled files. What I am telling about is the code deployed by netlify. After deploying the website I inspected the website using build tools and it contained node_modules.
I tried deploying after clearing cache it did’nt worked.
Okay, I also tried downloading the published code and I couldn’t find the node_modules in it. Can you please check inspecting the website source directly?
If it helps, I had checked the sources panel a few minutes after you had posted your question and I couldn’t see the node_modules folder. I was going to type a reply that I can’t see it, but, I thought, I’d let someone more knowledgeable weigh in.
EDIT: However, I can’t say for sure if the folder exists or not, as when I visited https://whatsend.netlify.app/node_modules/, I am not getting a 404. Are you redirecting 404 to your home page? If yes, then you can be sure that there’s no node_modules folder on your website.
@hrishikesh@AaronP I’m able to see all of the code written by this guy. So, the source is publicly visible, not only the production build generated by the CRA.
A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.
This was something done by the developer. Netlify doesn’t automatically do this but many frameworks used for a build at Netlify will. So, it is the site’s build code making these map files and it is not Netlify doing without their knowledge.