I wanna deploy my react app with webpack, and i have got the pack file, which is bundle.js, and set up nodejs and npm on the server. But I dont know what position I can put bundle.js on the remote server. anyone? thanks in advance

1 Answers

saltenhub On

I assume that by position you mean location on the server. It really depends on your configuration - you should somehow be able to achieve that the whole build folder is served by a webserver on your server. Check https://medium.freecodecamp.org/how-to-make-create-react-app-work-with-a-node-backend-api-7c5c48acb1b0 (section "Production deployment to heroku") for a sample configuration using the expressJS framework on nodeJS.

Or, since you only want to serve static files, you could also do npm -g install serve and serve -s path/to/your/build/dir