Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
W

webpack

> 数据库
Open source

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Throug

65.9K stars0 likes12 views
WebsiteGitHub

About

A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Throug

Table of Contents

  • Install
  • Introduction
  • Concepts
  • Contributing
  • Support
  • Current project members
    • TSC (Technical Steering Committee)
    • Core Collaborators
  • Sponsoring
    • Premium Partners
    • Gold Sponsors
    • Silver Sponsors
    • Bronze Sponsors
    • Backers
  • Special Thanks

Install

Install with npm:

bash
npm install --save-dev webpack

Install with yarn:

bash
yarn add webpack --dev

Introduction

Webpack is a bundler for modules. The main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

TL;DR

  • Bundles ES Modules, CommonJS, and AMD modules (even combined).
  • Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time).
  • Dependencies are resolved during compilation, reducing the runtime size.
  • Loaders can preprocess files while compiling, e.g. TypeScript to JavaScript, Handlebars strings to compiled functions, images to Base64, etc.
  • Highly modular plugin system to do whatever else your application requires.

Learn about webpack through videos!

  • Understanding Webpack - Video 1
  • Understanding Webpack - Video 2

Get Started

Check out webpack's quick Get Started guide and the other guides.

Browser Compatibility

Webpack supports all browsers that are ES5-compliant (IE8 and below are not supported). Webpack also needs Promise for import() and require.ensure(). If you want to support older browsers, you will need to load a polyfill before using these expressions.

Concepts

Plugins

Webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack very flexible.

Webpack can generate HTML pages and extract CSS files itself, both experimental — see what that covers, and what still needs a plugin, for CSS and HTML.

Name Status Install Size Description
compression-webpack-plugin compression-npm compression-size Prepares compressed versions of assets to serve them with Content-Encoding
html-bundler-webpack-plugin bundler-npm bundler-size Renders a template (EJS, Handlebars, Pug) with referenced source asset files into HTML.
pug-plugin pug-plugin-npm pug-plugin-size Renders Pug files to HTML, extracts JS and CSS from sources specified directly in Pug.

Loaders

Webpack enables the use of loaders to preprocess files. This allows you to bundle any static resource way beyond JavaScript. You can easily write your own loaders using Node.js.

Loaders are activated by using loadername! prefixes in require() statements, or are automatically applied via regex from your webpack configuration.

JavaScript, JSON and assets need no loader, and CSS and HTML have experimental built-in support — but preprocessors and template engines keep their loaders.

JSON

Name Status Install Size Description
cson-npm cson-size Loads and transpiles a CSON file

Transpiling

Name Status Install Size Description
babel-npm babel-size Loads ES2015+ code and transpiles to ES5 using Babel
type-npm type-size Loads TypeScript like JavaScript
coffee-npm coffee-size Loads CoffeeScript like JavaScript

Templating

Name Status Install Size Description
pug-npm pug-size Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular
md-npm md-size Compiles Markdown to HTML
posthtml-npm posthtml-size Loads and transforms a HTML file using PostHTML
hbs-npm hbs-size Compiles Handlebars to HTML

Styling

Name Status Install Size Description
less-npm less-size Loads and compiles a LESS file
sass-npm sass-size Loads and compiles a Sass/SCSS file
stylus-npm stylus-size Loads and compiles a Stylus file
postcss-npm postcss-size Loads and transforms a CSS/SSS file using PostCSS

Frameworks

|

Issues· 121 open

View all issuesOpen on GitHub
  • #20537

    unused default export not marked as unused, so isn't tree-shaken away

    Updated Sep 23, 2026
  • #14058

    Circular hash dependency for hashed folder names

    status: stalewebpack-5help wantedUpdated Sep 18, 2026
  • #22137

    webpack stopped concatenating modules in Violentmonkey's sw.js since 5.110.2

    area: optimizationregressionUpdated Sep 17, 2026
  • #22056

    ESM output bakes hashed chunk filenames into importing modules, defeating long-term caching (no opt-out)

    area: configarea: runtimeneeds: reproductionregressionUpdated Sep 14, 2026
  • #22030

    CSS: @value replacement in keyframes/animation produces broken output

    area: cssUpdated Sep 13, 2026
  • #9309

    Rule with issuer is not applied when importing via require.context

    webpack-5Updated Sep 8, 2026
  • #14386

    Webpack-native parallelism to obviate the need for the (unmaintained?) parallel-webpack package

    help wantedwebpack-6Updated Sep 6, 2026
  • #20536

    ModuleConcatenationPlugin bails out for modules in available parent chunks ("not in the same chunk")

    Updated Sep 2, 2026
  • #19359

    Asset module binary files are stored in webpack cache

    help wantedUpdated Sep 2, 2026
  • #15936

    export in library works only for last entry module

    webpack-5help wantedUpdated Sep 2, 2026

> Tags

JavaScriptamdbuild-toolcommonjscompiler

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库