4

I have created a simple react app and built the app using npm run build command and uploaded it to host. it works but whole application directory is visible in web browser console. So how do i fix it to not to show web directory on web console. Once the application kept growing and sensible data will visible. So is there any method to avoid that.

Here's the on cPanel File Manager

cPanel File Manager

and js directory has minified js like this,

 js directory content

But once it loads on web browser it shows App.js content,

enter image description here

Any suggestions.

pl-jay
  • 970
  • 1
  • 16
  • 33
  • So after running "npm run build" , publish your "build" folder. Not your "public" folder. – SeanMC May 27 '19 at 12:21
  • 1
    of course i did publish build folder, but application directory shown like that. – pl-jay May 27 '19 at 16:19
  • You must have published more than you thought at some point. I'd say delete everything on your server and republish again. Your whole node_modules folder is right there in your files published. Your static folder, unbundled js files. None of it should be there. None of that ends up in the build folder. Other files have been published – SeanMC May 27 '19 at 16:54
  • okay i will try. – pl-jay May 27 '19 at 17:05
  • no use, same output.check this here, http://kuppiya.cc/react_test/ – pl-jay May 27 '19 at 17:14

1 Answers1

1

After running "npm run build" , publish your "build" folder. Not your "public" folder.

SeanMC
  • 1,960
  • 1
  • 22
  • 33