How To Install Webpack In Debian, Ubuntu, Kali And MacOS?

How To Install Webpack In Debian, Ubuntu, Kali And MacOS?

webpack

Bundle a web project’s js files and other assets into a single output file.

Maintainer: Debian Javascript Maintainers



Section: javascript

Install webpack

  • Debian apt-get install webpack Click to copy
  • Ubuntu apt-get install webpack Click to copy
  • Kali Linux apt-get install webpack Click to copy
  • macOS brew install webpack Click to copy

Bundle a web project's js files and other assets into a single output file.

How to use webpack?

Below are few example commands for webpack that you can use in the terminal.

Create a single output file from an entry point file:
webpack app.js bundle.jsClick to copy
Load css files too from the js file (this uses the css loader for .css files):
webpack app.js bundle.js --module-bind 'css=css'Click to copy
Pass a config file (with eg. the entry script and the output filename) and show compilation progress:
webpack --config webpack.config.js --progressClick to copy
Automatically recompile on changes to project files:
webpack --watch app.js bundle.jsClick to copy
Installing webpack command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Kali and macOS operating systems. Once you run the command it will install the latest version of webpack 2026 package in your OS.