Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
${{ steps.preview.outputs.url }}/blog
${{ steps.preview.outputs.url }}/blog/posts/2026-02-04-roadmap-2026
${{ steps.preview.outputs.url }}/guides/getting-started
${{ steps.preview.outputs.url }}/docs/api/v5.x/options
${{ steps.preview.outputs.url }}/docs/api/options
${{ steps.preview.outputs.url }}/docs/loaders/css-loader

- name: Format Lighthouse report
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ authors: moshams272

These pages provide technical details on webpack's API.

- [Webpack](/docs/api/v5.x) — Explore the webpack's core configuration, CLI commands, and APIs.
- [Webpack](/docs/api) — Explore the webpack's core configuration, CLI commands, and APIs.
- [Loaders](/docs/loaders) — Discover third-party loaders to process CSS, TypeScript, images, and other file types.
- [Plugins](/docs/plugins) — Browse community plugins to extend webpack for build optimization, asset management, and more.
2 changes: 1 addition & 1 deletion pages/docs/plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ as optimizing output and managing assets. See
[Concepts: Plugins](/guides/getting-started/concepts/plugins) for how they fit
into a build.

Plugins built into webpack are documented in the [API reference](/docs/api/v5.x).
Plugins built into webpack are documented in the [API reference](/docs/api).
The plugins below are separate packages maintained by the webpack organization.

| Plugin | Description |
Expand Down
4 changes: 2 additions & 2 deletions pages/guides/contributing/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ authors: skipjack,tbroadley,madhavarshney,bhavya9107,akaustav

When contributing to the core repo, writing a loader/plugin, or even working on a complex project, debugging tools can be central to your workflow. Whether the problem is slow performance on a large project or an unhelpful traceback, the following utilities can make figuring it out less painful.

- The [`Stats` API](/docs/api/v5.x/stats/Stats) available through webpack's Node.js API and the [CLI](/docs/api/v5.x/cli).
- The [`Stats` API](/docs/api/stats/Stats) available through webpack's Node.js API and the [CLI](/docs/api/cli).
- Chrome **DevTools** and the latest Node.js version.

## Stats

Whether you inspect it manually or pass it to another tool, webpack's [`Stats` object](/docs/api/v5.x/stats/Stats) can be extremely useful when debugging build issues. It can provide the following information:
Whether you inspect it manually or pass it to another tool, webpack's [`Stats` object](/docs/api/stats/Stats) can be extremely useful when debugging build issues. It can provide the following information:

- The contents of every module.
- The modules contained within every chunk.
Expand Down
2 changes: 1 addition & 1 deletion pages/guides/contributing/writers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Use root-relative links for pages on this site and full `https://` URLs for exte
[Node.js](https://nodejs.org/)
```

Check links against the generated output, not the old webpack site. Current webpack API links include their version, for example `/docs/api/v5.x/options#mode`.
Check links against the generated output, not the old webpack site. Current webpack API links include their version, for example `/docs/api/options#mode`.

Do not add a trailing slash to a normal page route. Directory index pages, such as `/guides/contributing/`, are the exception.

Expand Down
4 changes: 2 additions & 2 deletions pages/guides/contributing/writing-a-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors: asulaiman,michael-ciniawsky,byzyk,anikethsaha,jamesgeorge007,chenxsan,d

# Writing a Loader

A loader is a Node.js module that exports a function. webpack calls this function when a resource needs to be transformed. The function receives the [loader context API](/docs/api/v5.x/loaders/types#interface-loaderrunnerloadercontext) through `this`.
A loader is a Node.js module that exports a function. webpack calls this function when a resource needs to be transformed. The function receives the [loader context API](/docs/api/loaders/types#interface-loaderrunnerloadercontext) through `this`.

## Setup

Expand Down Expand Up @@ -378,7 +378,7 @@ We'll use this loader to process the following file:
Hey [name]!
```

Pay close attention to this next step: we'll use webpack's [`Compiler` API](/docs/api/v5.x/compilation/Compiler) and [`memfs`](https://github.com/streamich/memfs) to execute webpack. This avoids writing output to disk and gives us access to the [`Stats` object](/docs/api/v5.x/stats/Stats), which we can use to inspect the transformed module:
Pay close attention to this next step: we'll use webpack's [`Compiler` API](/docs/api/compilation/Compiler) and [`memfs`](https://github.com/streamich/memfs) to execute webpack. This avoids writing output to disk and gives us access to the [`Stats` object](/docs/api/stats/Stats), which we can use to inspect the transformed module:

```bash
npm install --save-dev webpack memfs
Expand Down
8 changes: 4 additions & 4 deletions pages/guides/contributing/writing-a-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A plugin for webpack consists of:

- A named JavaScript function or a JavaScript class.
- Defines `apply` method in its prototype.
- Specifies a hook on the [`Compiler`](/docs/api/v5.x/compilation/Compiler) or [`Compilation`](/docs/api/v5.x/compilation/Compilation) to tap into.
- Specifies a hook on the [`Compiler`](/docs/api/compilation/Compiler) or [`Compilation`](/docs/api/compilation/Compilation) to tap into.
- Manipulates webpack internal instance specific data.
- Invokes webpack provided callback after functionality is complete.

Expand Down Expand Up @@ -131,7 +131,7 @@ export default class HelloWorldPlugin {

## Compiler and Compilation

The two most important resources when developing plugins are the [`Compiler`](/docs/api/v5.x/compilation/Compiler) and [`Compilation`](/docs/api/v5.x/compilation/Compilation) objects. Understanding their roles is an important first step in extending the webpack engine.
The two most important resources when developing plugins are the [`Compiler`](/docs/api/compilation/Compiler) and [`Compilation`](/docs/api/compilation/Compilation) objects. Understanding their roles is an important first step in extending the webpack engine.

```js
class HelloCompilationPlugin {
Expand All @@ -149,7 +149,7 @@ class HelloCompilationPlugin {
export default HelloCompilationPlugin;
```

For the public classes and types exposed by webpack, see the [webpack API reference](/docs/api/v5.x/).
For the public classes and types exposed by webpack, see the [webpack API reference](/docs/api/).

## Async event hooks

Expand Down Expand Up @@ -313,7 +313,7 @@ This will generate a markdown file with chosen name that looks like this:
> We are using synchronous `tap()` method to tap into the `processAssets` hook because we don't need to perform any asynchronous operations in the example above. However, the `processAssets` hook is an asynchronous one, so you can also use `tapPromise()` or `tapAsync()` if you actually need to.

> [!TIP]
> The `processAssets` hook on [`Compilation`](/docs/api/v5.x/compilation/Compilation) also supports the `additionalAssets` property. This lets a plugin intercept assets added both before and after its configured stage. In this example, the `SUMMARIZE` stage is sufficient to capture assets generated during earlier stages.
> The `processAssets` hook on [`Compilation`](/docs/api/compilation/Compilation) also supports the `additionalAssets` property. This lets a plugin intercept assets added both before and after its configured stage. In this example, the `SUMMARIZE` stage is sufficient to capture assets generated during earlier stages.

## Watching for file changes

Expand Down
2 changes: 1 addition & 1 deletion pages/guides/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors: bebraw,varunjayaraman,cntanglijun,chrisVillanueva,johnstew,simon04,aaro

webpack is a good fit when your application needs a customizable build pipeline: bundling JavaScript modules, processing assets, integrating loaders and plugins, and shaping output for different environments. For a very small page with one or two scripts, a bundler may be unnecessary at first; but for an application with shared dependencies, npm packages, assets, and production builds, webpack gives you explicit control over how everything is assembled.

webpack is used to efficiently compile JavaScript modules. Once [installed](/guides/getting-started/installing-webpack), you can interact with webpack through either its [CLI](https://github.com/webpack/webpack-cli) or its [API](/docs/api/v5.x). If you're new to webpack, please read through the [core concepts](/guides/getting-started/concepts) to learn why you might choose it over the other tools available in the community.
webpack is used to efficiently compile JavaScript modules. Once [installed](/guides/getting-started/installing-webpack), you can interact with webpack through either its [CLI](https://github.com/webpack/webpack-cli) or its [API](/docs/api). If you're new to webpack, please read through the [core concepts](/guides/getting-started/concepts) to learn why you might choose it over the other tools available in the community.

> [!WARNING]
> The examples in this guide use `webpack-cli` 7, which requires Node.js 20.9.0 or later.
Expand Down
2 changes: 1 addition & 1 deletion pages/site.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
{
"text": "API",
"link": "/docs/api/v5.x"
"link": "/docs/api"
},
{
"text": "Security Policy",
Expand Down
86 changes: 43 additions & 43 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
},
{
"source": "/guides/public-path",
"destination": "/docs/api/v5.x/options#outputpublicpath",
"destination": "/docs/api/options#outputpublicpath",
"permanent": false
},
{
Expand All @@ -203,212 +203,212 @@
},
{
"source": "/configuration",
"destination": "/docs/api/v5.x/options",
"destination": "/docs/api/options",
"permanent": false
},
{
"source": "/configuration/:path*",
"destination": "/docs/api/v5.x/options",
"destination": "/docs/api/options",
"permanent": false
},
{
"source": "/api",
"destination": "/docs/api/v5.x",
"destination": "/docs/api",
"permanent": false
},
{
"source": "/api/cli",
"destination": "/docs/api/v5.x/cli",
"destination": "/docs/api/cli",
"permanent": false
},
{
"source": "/api/loaders",
"destination": "/docs/api/v5.x/loaders/types",
"destination": "/docs/api/loaders/types",
"permanent": false
},
{
"source": "/api/node",
"destination": "/docs/api/v5.x/compilation/Compiler",
"destination": "/docs/api/compilation/Compiler",
"permanent": false
},
{
"source": "/api/stats",
"destination": "/docs/api/v5.x/stats/Stats",
"destination": "/docs/api/stats/Stats",
"permanent": false
},
{
"source": "/api/compiler-hooks",
"destination": "/docs/api/v5.x/compilation/Compiler",
"destination": "/docs/api/compilation/Compiler",
"permanent": false
},
{
"source": "/api/compilation-hooks",
"destination": "/docs/api/v5.x/compilation/Compilation",
"destination": "/docs/api/compilation/Compilation",
"permanent": false
},
{
"source": "/api/compilation-object",
"destination": "/docs/api/v5.x/compilation/Compilation",
"destination": "/docs/api/compilation/Compilation",
"permanent": false
},
{
"source": "/api/parser",
"destination": "/docs/api/v5.x/javascript/JavascriptParser",
"destination": "/docs/api/javascript/JavascriptParser",
"permanent": false
},
{
"source": "/api/resolvers",
"destination": "/docs/api/v5.x/resolvers/Resolver",
"destination": "/docs/api/resolvers/Resolver",
"permanent": false
},
{
"source": "/api/:path((?!sponsors$).*)",
"destination": "/docs/api/v5.x",
"destination": "/docs/api/:path",
"permanent": false
},
{
"source": "/plugins/automatic-prefetch-plugin",
"destination": "/docs/api/v5.x/plugins/AutomaticPrefetchPlugin",
"destination": "/docs/api/plugins/AutomaticPrefetchPlugin",
"permanent": false
},
{
"source": "/plugins/banner-plugin",
"destination": "/docs/api/v5.x/plugins/BannerPlugin",
"destination": "/docs/api/plugins/BannerPlugin",
"permanent": false
},
{
"source": "/plugins/context-exclusion-plugin",
"destination": "/docs/api/v5.x/plugins/ContextExclusionPlugin",
"destination": "/docs/api/plugins/ContextExclusionPlugin",
"permanent": false
},
{
"source": "/plugins/context-replacement-plugin",
"destination": "/docs/api/v5.x/plugins/ContextReplacementPlugin",
"destination": "/docs/api/plugins/ContextReplacementPlugin",
"permanent": false
},
{
"source": "/plugins/define-plugin",
"destination": "/docs/api/v5.x/plugins/DefinePlugin",
"destination": "/docs/api/plugins/DefinePlugin",
"permanent": false
},
{
"source": "/plugins/dll-plugin",
"destination": "/docs/api/v5.x/plugins/DllPlugin",
"destination": "/docs/api/plugins/DllPlugin",
"permanent": false
},
{
"source": "/plugins/environment-plugin",
"destination": "/docs/api/v5.x/plugins/EnvironmentPlugin",
"destination": "/docs/api/plugins/EnvironmentPlugin",
"permanent": false
},
{
"source": "/plugins/eval-source-map-dev-tool-plugin",
"destination": "/docs/api/v5.x/plugins/EvalSourceMapDevToolPlugin",
"destination": "/docs/api/plugins/EvalSourceMapDevToolPlugin",
"permanent": false
},
{
"source": "/plugins/hashed-module-ids-plugin",
"destination": "/docs/api/v5.x/ids/HashedModuleIdsPlugin",
"destination": "/docs/api/ids/HashedModuleIdsPlugin",
"permanent": false
},
{
"source": "/plugins/hot-module-replacement-plugin",
"destination": "/docs/api/v5.x/plugins/HotModuleReplacementPlugin",
"destination": "/docs/api/plugins/HotModuleReplacementPlugin",
"permanent": false
},
{
"source": "/plugins/ignore-plugin",
"destination": "/docs/api/v5.x/plugins/IgnorePlugin",
"destination": "/docs/api/plugins/IgnorePlugin",
"permanent": false
},
{
"source": "/plugins/limit-chunk-count-plugin",
"destination": "/docs/api/v5.x/optimize/LimitChunkCountPlugin",
"destination": "/docs/api/optimize/LimitChunkCountPlugin",
"permanent": false
},
{
"source": "/plugins/manifest-plugin",
"destination": "/docs/api/v5.x/plugins/ManifestPlugin",
"destination": "/docs/api/plugins/ManifestPlugin",
"permanent": false
},
{
"source": "/plugins/merge-duplicate-chunks-plugin",
"destination": "/docs/api/v5.x/optimize/MergeDuplicateChunksPlugin",
"destination": "/docs/api/optimize/MergeDuplicateChunksPlugin",
"permanent": false
},
{
"source": "/plugins/min-chunk-size-plugin",
"destination": "/docs/api/v5.x/optimize/MinChunkSizePlugin",
"destination": "/docs/api/optimize/MinChunkSizePlugin",
"permanent": false
},
{
"source": "/plugins/module-concatenation-plugin",
"destination": "/docs/api/v5.x/optimize/ModuleConcatenationPlugin",
"destination": "/docs/api/optimize/ModuleConcatenationPlugin",
"permanent": false
},
{
"source": "/plugins/module-federation-plugin",
"destination": "/docs/api/v5.x/container/ModuleFederationPlugin",
"destination": "/docs/api/container/ModuleFederationPlugin",
"permanent": false
},
{
"source": "/plugins/normal-module-replacement-plugin",
"destination": "/docs/api/v5.x/plugins/NormalModuleReplacementPlugin",
"destination": "/docs/api/plugins/NormalModuleReplacementPlugin",
"permanent": false
},
{
"source": "/plugins/no-emit-on-errors-plugin",
"destination": "/docs/api/v5.x/plugins/NoEmitOnErrorsPlugin",
"destination": "/docs/api/plugins/NoEmitOnErrorsPlugin",
"permanent": false
},
{
"source": "/plugins/prefetch-plugin",
"destination": "/docs/api/v5.x/plugins/PrefetchPlugin",
"destination": "/docs/api/plugins/PrefetchPlugin",
"permanent": false
},
{
"source": "/plugins/profiling-plugin",
"destination": "/docs/api/v5.x/debug/ProfilingPlugin",
"destination": "/docs/api/debug/ProfilingPlugin",
"permanent": false
},
{
"source": "/plugins/progress-plugin",
"destination": "/docs/api/v5.x/plugins/ProgressPlugin",
"destination": "/docs/api/plugins/ProgressPlugin",
"permanent": false
},
{
"source": "/plugins/provide-plugin",
"destination": "/docs/api/v5.x/plugins/ProvidePlugin",
"destination": "/docs/api/plugins/ProvidePlugin",
"permanent": false
},
{
"source": "/plugins/source-map-dev-tool-plugin",
"destination": "/docs/api/v5.x/plugins/SourceMapDevToolPlugin",
"destination": "/docs/api/plugins/SourceMapDevToolPlugin",
"permanent": false
},
{
"source": "/plugins/split-chunks-plugin",
"destination": "/docs/api/v5.x/optimize/SplitChunksPlugin",
"destination": "/docs/api/optimize/SplitChunksPlugin",
"permanent": false
},
{
"source": "/plugins/virtual-url-plugin",
"destination": "/docs/api/v5.x/experiments/schemes/VirtualUrlPlugin",
"destination": "/docs/api/experiments/schemes/VirtualUrlPlugin",
"permanent": false
},
{
"source": "/plugins/watch-ignore-plugin",
"destination": "/docs/api/v5.x/plugins/WatchIgnorePlugin",
"destination": "/docs/api/plugins/WatchIgnorePlugin",
"permanent": false
},
{
"source": "/plugins",
"destination": "/docs/api/v5.x",
"destination": "/docs/api",
"permanent": false
},
{
"source": "/plugins/:path*",
"destination": "/docs/api/v5.x",
"destination": "/docs/api",
"permanent": false
},
{
Expand Down
Loading