DEV Community

Cover image for What are Webpack?
Ank
Ank

Posted on

What are Webpack?

Webpack is a free and open-source module bundler for JavaScript. 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.Webpack takes modules with dependencies and generates static assets representing those modules.

Repository
github.com/webpack/webpack
Written in
JavaScript
Operating system
Linux, macOS, Windows
Platform
Node.js
License
MIT License[3][4]
Website
webpack.js.org

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.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

Introducing RTABench

To meet the need for real-time analytics workloads, we developed RTABench, a benchmark designed to test databases with these specific requirements. RTABench focuses on essential query patterns such as joins, filtering, and pre-aggregations.