Webpack

Webpack

Webpack

Open-source JavaScript module bundler


Webpack is a free and open-source module bundler for JavaScript.[5][6][7][8] It is made primarily for JavaScript, but it can transform front-end assets such as HTML, CSS, and images if the corresponding loaders are included.[9] Webpack takes modules with dependencies and generates static assets representing those modules.[10]

Quick Facts Developer(s), Initial release ...

Webpack takes the dependencies and generates a dependency graph allowing web developers to use a modular approach for their web application development purposes. It can be used from the command line or can be configured using a configuration file which is named webpack.config.js. This file defines rules, plugins, etc., for a project. (Webpack is highly extensible via rules which allow developers to write custom tasks that they want to perform when bundling files together.)

Node.js is required to use Webpack.

Webpack provides code on demand using the moniker code splitting. Two similar techniques are supported by Webpack when it comes to dynamic code splitting. The first and recommended approach is to use the import() syntax that conforms to the ECMAScript proposal for dynamic imports. The legacy, Webpack-specific approach is to use require.ensure.[11]

Webpack development server

Webpack also provides a built-in development server, webpack-dev-server, that can be used as an HTTP server for serving files while developing. It also provides the capability to use hot module replacement (HMR), which updates code on a webpage without requiring the developer to reload the page.

See also


References

  1. "Release Date of Version 1.0.0". Retrieved 2020-12-31.
  2. "Release 5.91.0". 20 March 2024. Retrieved 26 March 2024.
  3. "LICENSE file on GitHub". Retrieved 2020-12-31.
  4. "Web Performance Optimization with webpack". Google Inc. Retrieved 16 Oct 2018.
  5. "What is webpack". SurviveJS. Retrieved 16 Oct 2018.
  6. "What is webpack". GitHub. Retrieved 25 Feb 2018.
  7. "Dynamic imports". webpack. Retrieved 6 Jun 2022.

Share this article:

This article uses material from the Wikipedia article Webpack, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.