I'm developing a react-bootstrap website and I'm wondering if I should include the node_modules folder when i will publish the site on a web hosting platform, or there is another way? I never published before a website with a lot of dependencies
CodePudding user response:
usually it's bad practice to upload node modules! there's no need to upload node_modules folder to server, you can install them using npm install
or yarn install
in case your are using yarn. it will create node_modules folder with all the dependencies which you have installed make sure your all dependencies are added in package.json
CodePudding user response:
It depends on your approach , if you want to create simple SPA you could run "npm run build" which will give a build folder and once you uploaded those file on the server and point your requsts to index.html You wont be needing node_modules , BUT having a differant approach , having SSR maybe then yes , you would need to start your project on the server which will need node_modules as well.