[![npm][npm]][npm-url]
[![node][node]][node-url]
[![builds1][builds1]][builds1-url]
[![dependency-review][dependency-review]][dependency-review-url]
[![coverage][cover]][cover-url]
[![PR's welcome][prs]][prs-url]
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.
Install with npm:
npm install --save-dev webpack
Install with yarn:
yarn add webpack --dev
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
Check out webpack's quick Get Started guide and the other guides.
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.
Webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack very flexible.
| Name | Status | Install Size | Description |
|---|---|---|---|
| mini-css-extract-plugin | Extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. | ||
| compression-webpack-plugin | Prepares compressed versions of assets to serve them with Content-Encoding | ||
| html-bundler-webpack-plugin | Renders a template (EJS, Handlebars, Pug) with referenced source asset files into HTML. | ||
| html-webpack-plugin | Simplifies creation of HTML files (index.html) to serve your bundles |
||
| pug-plugin | Renders Pug files to HTML, extracts JS and CSS from sources specified directly in Pug. |
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.
| Name | Status | Install Size | Description |
|---|---|---|---|
| Loads and transpiles a CSON file |
| Name | Status | Install Size | Description |
|---|---|---|---|
| Loads ES2015+ code and transpiles to ES5 using Babel | |||
| Loads TypeScript like JavaScript | |||
| Loads CoffeeScript like JavaScript |
| Name | Status | Install Size | Description |
|---|---|---|---|
| Exports HTML as string, requires references to static resources | |||
| Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular | |||
| Compiles Markdown to HTML | |||
| Loads and transforms a HTML file using PostHTML | |||
| Compiles Handlebars to HTML |
| Name | Status | Install Siz
$ claude mcp add webpack \
-- python -m otcore.mcp_server <graph>