Radek Radek - 3 years ago 135
Node.js Question

Webpack bundle.js content

I start learning webpack , node , and react and I am bit confused about some basic staff.

Doeas webpack bundle whole react.js + my javascript files into one output file, so when deploying to production I don't need to install node packages used in project ( assuming that they are added to webpack.config.js file) ?

If above is righ :

  • On my server I just need to place index.html + output from
    webpack ( bundle.js) ? ( In simple scenario) ?

  • package.json will be used only on development side ?

Answer Source

You only need index.html and the bundle.js (or any name you gave the file) for the app to work, provided that you are not using any local assets. You don't need to include node modules. Package.json should tell you what to include in your project so that you don't have to include node modules whenever you want to upload your project along with few other decalarations.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download