Skip to main content

- 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
- Install webpack globally "npm install -g webpack-cli"
- or "npm install webpack webpack-cli g" command.
- Now you can use webpack command.
- webpack --version to check webpack version
- Copy webpack.config.js file from webpack website and paste it to vscode after creating this file
- Give the path of the js file in place of entry point in webpack.config.js file
- Now run webpack command in terminal you will see teh dundle.js file in the given path.
- Make sure you are the directory where "webpack.config.js" file is while writing the command webpack to bundle
- Make Sure your path is entry is correct
Comments
Post a Comment