GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - webpack/webpack: 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. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

BranchesTags
Open more actions menu

Latest commit

 

History

20,463 Commits
20,463 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.claude
.claude
 
 
.github
.github
 
 
.husky
.husky
 
 
assembly
assembly
 
 
bin
bin
 
 
declarations
declarations
 
 
docs
docs
 
 
examples
examples
 
 
hot
hot
 
 
lib
lib
 
 
schemas
schemas
 
 
setup
setup
 
 
test
test
 
 
tooling
tooling
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.istanbul.yml
.istanbul.yml
 
 
.npmrc
.npmrc
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.js
.prettierrc.js
 
 
.yarnrc
.yarnrc
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
GOVERNANCE.md
GOVERNANCE.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
RELEASE_SCHEDULE.md
RELEASE_SCHEDULE.md
 
 
TESTING_DOCS.md
TESTING_DOCS.md
 
 
WORKING_GROUP.md
WORKING_GROUP.md
 
 
_SETUP.md
_SETUP.md
 
 
codecov.yml
codecov.yml
 
 
cspell.json
cspell.json
 
 
declarations.d.ts
declarations.d.ts
 
 
declarations.test.d.ts
declarations.test.d.ts
 
 
eslint.config.mjs
eslint.config.mjs
 
 
generate-types-config.js
generate-types-config.js
 
 
jest.config.js
jest.config.js
 
 
module.d.ts
module.d.ts
 
 
open-bot.yaml
open-bot.yaml
 
 
package.json
package.json
 
 
tsconfig.hot.json
tsconfig.hot.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.module.test.json
tsconfig.module.test.json
 
 
tsconfig.types.benchmark.json
tsconfig.types.benchmark.json
 
 
tsconfig.types.json
tsconfig.types.json
 
 
tsconfig.types.test.json
tsconfig.types.test.json
 
 
tsconfig.validation.json
tsconfig.validation.json
 
 
types.d.ts
types.d.ts
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation



npm

node builds1 dependency-review coverage pkg.pr.new PR's welcome compatibility-score downloads install-size backers sponsors contributors discussions discord LFX Health Score Agent Friendly

webpack

Webpack is a module bundler. Its 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.

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:

npm install --save-dev webpack

Install with yarn:

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 generates HTML pages and extracts CSS files itself — stable and on by default since 5.109.0, replacing the deprecated html-webpack-plugin and mini-css-extract-plugin. Point an entry at an .html file, or set output.html: true to generate a page for a JavaScript entry (if a rule of your own already handles .html files, also set experiments.html: true; that also resolves an ESM import without an extension, such as ./page, to page.html before page.js). See what that covers 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 built-in support, so css-loader, style-loader and html-loader are no longer needed — 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

Name Status Install Size Description
vue-npm vue-size Loads and compiles Vue Components
polymer-npm polymer-size Process HTML & CSS with preprocessor of choice and require() Web Components like first-class modules
angular-npm angular-size Loads and compiles Angular 2 Components
riot-npm riot-size Riot official webpack loader
svelte-npm svelte-size Official Svelte loader

Performance

Webpack uses async I/O and has multiple caching levels. This makes webpack fast and incredibly fast on incremental compilations.

Module Formats

Webpack supports ES2015+, CommonJS and AMD modules out of the box. It performs clever static analysis on the AST of your code. It even has an evaluation engine to evaluate simple expressions. This allows you to support most existing libraries out of the box.

Code Splitting

Webpack allows you to split your codebase into multiple chunks. Chunks are loaded asynchronously at runtime. This reduces the initial loading time.

Optimizations

Webpack can do many optimizations to reduce the output size of your JavaScript by deduplicating frequently used modules, minifying, and giving you full control of what is loaded initially and what is loaded at runtime through code splitting. It can also make your code chunks cache friendly by using hashes.

Developer Tools

If you're working on webpack itself, or building advanced plugins or integrations, the tools below can help you explore internal mechanics, debug plugin life-cycles, and build custom tooling.

Instrumentation

Name Status Description
tapable-tracer tapable-tracer-npm Traces tapable hook execution in real-time and collects structured stack frames. Can export to UML for generating visualizations.

Contributing

We want contributing to webpack to be fun, enjoyable, and educational for anyone, and everyone. We have a vibrant ecosystem that spans beyond this single repo. We welcome you to check out any of the repositories in our organization or webpack-contrib organization which houses all of our loaders and plugins.

Contributions go far beyond pull requests and commits. Although we love giving you the opportunity to put your stamp on webpack, we also are thrilled to receive a variety of other contributions including:

  • Documentation updates, enhancements, designs, or bugfixes
  • Spelling or grammar fixes
  • README.md corrections or redesigns
  • Adding unit, or functional tests
  • Triaging GitHub issues -- especially determining whether an issue still persists or is reproducible.
  • Searching #webpack on twitter and helping someone else who needs help
  • Teaching others how to contribute to one of the many webpack's repos!
  • Blogging, speaking about, or creating tutorials about one of webpack's many features.
  • Helping others in our webpack gitter channel.
  • The Contributor's Guide to webpack

To get started have a look at our documentation on contributing.

For when your change reaches npm, see RELEASE_SCHEDULE.md — patch releases go out as soon as possible, minor releases every 4 weeks on Thursday.

Creating your own plugins and loaders

If you create a loader or plugin, we would <3 for you to open source it, and put it on npm. We follow the x-loader, x-webpack-plugin naming convention.

Support

We consider webpack to be a low-level tool used not only individually but also layered beneath other awesome tools. Because of its flexibility, webpack isn't always the easiest entry-level solution, however we do believe it is the most powerful. That said, we're always looking for ways to improve and simplify the tool without compromising functionality. If you have any ideas on ways to accomplish this, we're all ears!

If you're just getting started, take a look at our new docs and concepts page. This has a high level overview that is great for beginners!!

If you have discovered a 🐜 or have a feature suggestion, feel free to create an issue on GitHub.

Current project members

For information about the governance of the webpack project, see GOVERNANCE.md.

TSC (Technical Steering Committee)

  • alexander-akait - Alexander Akait <[email protected]> (he/him)
  • avivkeller - Aviv Keller <[email protected]> (he/him)
  • evenstensberg - Even Stensberg <[email protected]> (he/him)
  • thelarkinn - Sean Larkin <[email protected]> (he/him)
  • xiaoxiaojx - Natsu Xiao <[email protected]> (he/him)
  • hai-x - Haijie Xie <[email protected]> (he/him)

Maintenance

This webpack repository is maintained by the Core Working Group.

Sponsoring

Most of the core team members, webpack contributors and contributors in the ecosystem do this open source work in their free time. If you use webpack for a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.

This is how we use the donations:

  • Allow the core team to work on webpack
  • Thank contributors if they invested a large amount of time in contributing
  • Support projects in the ecosystem that are of great value for users
  • Support projects that are voted most (work in progress)
  • Infrastructure cost
  • Fees for money handling

Premium Partners

Other Backers and Sponsors

Before we started using OpenCollective, donations were made anonymously. Now that we have made the switch, we would like to acknowledge these sponsors (and the ones who continue to donate using OpenCollective). If we've missed someone, please send us a PR, and we'll add you to this list.

Angular MoonMail MONEI

Gold Sponsors

Become a gold sponsor and get your logo on our README on GitHub with a link to your site.

Silver Sponsors

Become a silver sponsor and get your logo on our README on GitHub with a link to your site.

Bronze Sponsors

Become a bronze sponsor and get your logo on our README on GitHub with a link to your site.

Backers

Become a backer and get your image on our README on GitHub with a link to your site.

Other Partners

  • CodSpeed for generously supporting us with benchmarks on their paid runners.

Special Thanks to

(In chronological order)

  • @google for Google Web Toolkit (GWT), which aims to compile Java to JavaScript. It features a similar Code Splitting as webpack.
  • @medikoo for modules-webmake, which is a similar project. webpack was born because of the desire for code splitting for modules such as Webmake. Interestingly, the Code Splitting issue is still open (thanks also to @Phoscur for the discussion).
  • @substack for browserify, which is a similar project and source for many ideas.
  • @jrburke for require.js, which is a similar project and source for many ideas.
  • @defunctzombie for the browser-field spec, which makes modules available for node.js, browserify and webpack.
  • @sokra for creating webpack.
  • Every early webpack user, which contributed to webpack by writing issues or PRs. You influenced the direction.
  • All past and current webpack maintainers and collaborators.
  • Everyone who has written a loader for webpack. You are the ecosystem...
  • Everyone not mentioned here but that has also influenced webpack.

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. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

webpack.js.org

Topics

amdbuild-toolcommonjscompileres2015es6esmjavascriptjavascript-compilerjavascript-modulesloadersmodule-bundlerpluginswebweb-performancewebpack

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

66.0k stars

Watchers

1.4k watching

Forks

9.6k forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.