Webpack

                                            
  • Module bundler tool used to combine multiple JavaScript modules into single file for the use of browser or node.js environment.

  • Steps to Bundle JavaScript file using webpack
  1. Install webpack globally  "npm install -g webpack-cli"
  2.  or "npm install webpack webpack-cli g" command.
  3. Now you can use webpack command.
  4. webpack --version to check webpack version
  5. Copy webpack.config.js file from webpack website and paste it to vscode after creating this file
  6. Give the path of the js file in place of entry point in webpack.config.js file
  7. Now run webpack command in terminal you will see teh dundle.js file in the given path.
  8. Make sure you are the directory where "webpack.config.js" file is while writing the command webpack to bundle
  9. Make Sure your path is entry is correct



Comments