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
17 changes: 9 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ We hope this guide helps you find the right kind of contribution and get product

The website assembles content from several sources, so the first step is confirming you are in the right place:

| You want to change… | Go to… |
| ---------------------------------------------------------- | ------------------------------------------------------------ |
| Guides, blog posts, or other hand-written pages (`pages/`) | **This repository** |
| The build tooling, API doc generation, or site theme | **This repository** |
| Generated API reference pages (`/docs/api/`) | [webpack/webpack](https://github.com/webpack/webpack) |
| Loader or plugin reference pages | The README of that loader or plugin's repository |
| The Markdown-to-HTML engine itself | [nodejs/doc-kit](https://github.com/nodejs/doc-kit) |
| webpack's actual behavior | [webpack/webpack](https://github.com/webpack/webpack/issues) |
| You want to change… | Go to… |
| ---------------------------------------------------------- | -------------------------------------------------------------------- |
| Guides, blog posts, or other hand-written pages (`pages/`) | **This repository** |
| The build tooling, API doc generation, or site theme | **This repository** |
| Generated API reference pages (`/docs/api/`) | [webpack/webpack](https://github.com/webpack/webpack) |
| Loader or plugin reference pages | The README of that loader or plugin's repository |
| The Markdown-to-HTML engine itself | [nodejs/doc-kit](https://github.com/nodejs/doc-kit) |
| webpack's actual behavior | [webpack/webpack](https://github.com/webpack/webpack/issues) |
| The CLI's actual behavior (flags, commands, scaffolding) | [webpack/webpack-cli](https://github.com/webpack/webpack-cli/issues) |

When in doubt, [ask in the webpack Discord](https://discord.com/invite/webpack) and we will point you in the right direction.

Expand Down
4 changes: 2 additions & 2 deletions pages/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ output. webpack 5 introduced persistent caching, improved tree shaking, module
federation, and the removal of automatic Node.js core polyfills.

webpack being a bundler doesn't mean you give up a fast feedback loop during
development. The [`webpack-dev-server`](/docs/webpack-dev-server/)
development. The [`webpack-dev-server`](https://github.com/webpack/webpack-dev-server)
provides live reloading and Hot Module Replacement, swapping updated modules into
a running application without a full page refresh. Built on the same foundation,
code splitting lets you break bundles into chunks that load on demand, keeping
Expand Down Expand Up @@ -97,7 +97,7 @@ organization:

webpack communicates through various official and community-supported channels.
You can find details on how to get involved on the
[Get Involved](/contribute/) page, and you can support the
[Contributing guide](https://github.com/webpack/webpack/blob/main/CONTRIBUTING.md), and you can support the
project through its [Open Collective](https://opencollective.com/webpack).

### Reporting Issues
Expand Down
24 changes: 24 additions & 0 deletions pages/about/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: License
authors: EugeneHlushko,pranshuchittora,avivkeller
---

# License

Different parts of the webpack project are covered by different licenses. This page explains which applies to what.

## webpack

webpack is [MIT licensed](https://github.com/webpack/webpack/blob/main/LICENSE). The same applies to the loaders, plugins, and tooling published by the [webpack organization](https://github.com/webpack) unless a repository states otherwise.

## webpack logo and icon

The webpack logo and icon are **not** covered by the MIT license. They are published separately in the [webpack/media](https://github.com/webpack/media) repository under their own terms. See the [branding guidelines](/about/branding) before using them.

## webpack documentation

The content on [webpack.js.org](https://webpack.js.org) is available under the [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) license, which means attribution is required if you reuse it elsewhere.

## webpack code samples

The code samples embedded in this documentation are released under [CC0 1.0 Universal (Public Domain Dedication)](https://creativecommons.org/publicdomain/zero/1.0/). You are free to use them however you like, with no attribution required.
6 changes: 3 additions & 3 deletions pages/blog/posts/2020-10-10-webpack-5-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This release focus on the following:

## **Migration** Guide

[See here for a **migration** guide](/migrate/5)
[See here for a **migration** guide](/guides/migration/to-v5)

## Major Changes: Removals

Expand Down Expand Up @@ -159,7 +159,7 @@ Webpack 5 adds a new feature called "Module Federation", which allows multiple w
From runtime perspective modules from multiple builds will behave like a huge connected module graph.
From developer perspective modules can be imported from specified remote builds and used with minimal restrictions.

For more details see [this separate guide](/concepts/module-federation).
For more details see [this separate guide](/guides/getting-started/concepts/module-federation).

## Major Changes: New Web Platform Features

Expand Down Expand Up @@ -247,7 +247,7 @@ The `exports` and `imports` field in package.json is now supported.

Yarn PnP is supported natively.

See more details in [package exports](/guides/package-exports/).
See more details in [package exports](/guides/modules-and-dependencies/package-exports).

## Major Changes: Development Experience

Expand Down
18 changes: 5 additions & 13 deletions pages/blog/posts/2026-02-03-webpack-5-105.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Webpack 5.105 brings several improvements, both in code generation and bug fixes

Two new low-severity CVEs in Webpack have been fixed and published.
By default, you are safe; these issues only affect users of the experimental
[`experiments.buildHttp`](/configuration/experiments/#experimentsbuildhttp) option.
[`experiments.buildHttp`](/docs/api/options#experimentsbuildhttp) option.

### Affected CVEs:

Expand Down Expand Up @@ -107,17 +107,13 @@ For example, in `package.json`:

Now, when importing the `foo` package inside a Worker, Webpack will automatically choose the `index.worker.js` file according to the export conditions:

{/_ eslint-disable _/}

```js
// This import is inside a Worker context, so Webpack uses index.worker.js
const worker = new Worker(new URL('foo', import.meta.url), {
type: 'module',
});
```

{/_ eslint-enable _/}

## Support Import Specifier Guard

Support for import specifier guards has been added, an improvement that helps the bundler better understand a common pattern checking whether an export exists before using it. Previously, even if the code was correctly guarded by an if, the access could be interpreted as unconditional and result in warnings like “export … was not found”.
Expand All @@ -138,18 +134,14 @@ if (React.useId) {

Webpack now supports `import.defer()` even when the import is a context module (that is, when the import path is built dynamically and webpack needs to include a set of possible files). In practice, this makes it much easier to defer the loading of a module selected at runtime, even when that module comes from a dynamic expression pointing to a directory. This enables patterns like “choose between a.js or b.js and load it only when needed”, with webpack generating the appropriate context so that import.defer() works correctly.

{/_ eslint-disable _/}

```text
const file = Math.random() > 0.5 ? "a.js" : "b.js";
import.defer("./dir/" + file);
```

{/_ eslint-enabled _/}

## Preserving Custom `import.meta` Properties

Webpack now preserves custom `import.meta` properties during bundling when [`output.module`](/configuration/output/#outputmodule) is enabled. Previously, Webpack would remove any unknown `import.meta` properties (such as `import.meta.customProp`), causing the loss of contextual or tool-specific information in the build.
Webpack now preserves custom `import.meta` properties during bundling when [`output.module`](/docs/api/options#outputmodule) is enabled. Previously, Webpack would remove any unknown `import.meta` properties (such as `import.meta.customProp`), causing the loss of contextual or tool-specific information in the build.

With this change, any non-standard property you add to `import.meta` will remain intact in the generated code, allowing the use of custom meta-information or additional signals in modern applications.

Expand All @@ -160,7 +152,7 @@ if (!import.meta.UNKNOWN_PROPERTY) {
}
```

If `output.module` is not enabled, Webpack will continue to remove unknown properties unless you explicitly indicate otherwise. To preserve them manually, you can configure [`module.parser.javascript.importMeta`](/configuration/module/#moduleparserjavascriptimportmeta) as 'preserve-unknown' in your `webpack.config.js`:
If `output.module` is not enabled, Webpack will continue to remove unknown properties unless you explicitly indicate otherwise. To preserve them manually, you can configure [`module.parser.javascript.importMeta`](/docs/api/options#moduleparserjavascriptimportmeta) as 'preserve-unknown' in your `webpack.config.js`:

```js
// webpack.config.js
Expand Down Expand Up @@ -210,13 +202,13 @@ module.exports = {

In this example, standard source maps are applied to all modules, and inline source maps are used specifically for CSS files.

This new option is especially useful if you are using Webpack’s [experimental CSS compilation feature](/configuration/experiments/#experimentscss), as it gives you greater control over the debugging process and improves integration with external tools.
This new option is especially useful if you are using Webpack’s [experimental CSS compilation feature](/docs/api/options#experimentscss), as it gives you greater control over the debugging process and improves integration with external tools.

It’s worth noting that the classic string syntax, like `devtool: "source-map"`, remains fully valid and supported.

## Cleaner ESM Output for Node.js and Modern Builds

This improvement in Webpack optimizes the handling and representation of Node.js native modules (such as `fs`, `path`, or `crypto`) during bundling, especially when using the [`output.module`](/configuration/output/#outputmodule) option in the configuration. When `output.module: true` is enabled, Webpack now generates imports of native modules using ES module syntax `import ... from "module"` instead of CommonJS `require("module")`, regardless of whether the code will run in a web or Node.js environment.
This improvement in Webpack optimizes the handling and representation of Node.js native modules (such as `fs`, `path`, or `crypto`) during bundling, especially when using the [`output.module`](/docs/api/options#outputmodule) option in the configuration. When `output.module: true` is enabled, Webpack now generates imports of native modules using ES module syntax `import ... from "module"` instead of CommonJS `require("module")`, regardless of whether the code will run in a web or Node.js environment.

## Other Improvements and Bug Fixes

Expand Down
6 changes: 3 additions & 3 deletions pages/blog/posts/2026-02-04-roadmap-2026.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Below, we’ll walk through the main areas we’re actively working on and the i

### [webpack#14893](https://github.com/webpack/webpack/issues/14893) - Support for CSS Modules without the need for plugins

There is currently an [`experimental.css`](/configuration/experiments/#experimentscss) option, which enables **native CSS support** without the need to add plugins to your configuration, as was previously required with plugins like [`mini-css-extract-plugin`](/plugins/mini-css-extract-plugin).
There is currently an [`experimental.css`](/docs/api/options#experimentscss) option, which enables **native CSS support** without the need to add plugins to your configuration, as was previously required with plugins like [`mini-css-extract-plugin`](/docs/plugins/mini-css-extract-plugin).

The development is already quite advanced, with the possibility of finishing the inclusion into webpack core around **February/March**. After that, the support would remain _experimental_ for a while to gather bug reports, but in **webpack 6** it will no longer be experimental and **plugins for this task will no longer be necessary**.

Expand All @@ -40,11 +40,11 @@ You can also join the discussion about [universal target](https://github.com/web

### Support for building TypeScript without loaders

Recently, in version [5.105](/blog/2026-02-03-webpack-5-105/) we included support for **resolving the paths defined in the TypeScript configuration**, eliminating the need to use a plugin ([tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin)). Now we want to further expand TypeScript support by **removing the need to use a loader** (the most common one being _ts-loader_) to transpile TypeScript directly in webpack, which would also **reduce your project’s dependencies**.
Recently, in version [5.105](/blog/posts/2026-02-03-webpack-5-105) we included support for **resolving the paths defined in the TypeScript configuration**, eliminating the need to use a plugin ([tsconfig-paths-webpack-plugin](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin)). Now we want to further expand TypeScript support by **removing the need to use a loader** (the most common one being _ts-loader_) to transpile TypeScript directly in webpack, which would also **reduce your project’s dependencies**.

### [webpack#536](https://github.com/webpack/webpack/issues/536) - Import HTML files and use them as entry points without the need for plugins

Currently, to import HTML files and use them as entry points, it’s necessary to use a plugin ([_html-webpack-plugin_](/plugins/html-webpack-plugin)). The idea is to **integrate that plugin into the core of webpack itself**, similar to how CSS Modules are being handled, and remove the need for a plugin for such a common task. Like CSS Modules, this would be introduced as an _experimental option_, so that in **webpack 6** you’ll be able to remove that dependency.
Currently, to import HTML files and use them as entry points, it’s necessary to use a plugin ([_html-webpack-plugin_](https://github.com/jantimon/html-webpack-plugin)). The idea is to **integrate that plugin into the core of webpack itself**, similar to how CSS Modules are being handled, and remove the need for a plugin for such a common task. Like CSS Modules, this would be introduced as an _experimental option_, so that in **webpack 6** you’ll be able to remove that dependency.

You can follow the idea and its progress in the related issue ([#536](https://github.com/webpack/webpack/issues/536)).

Expand Down
2 changes: 1 addition & 1 deletion pages/blog/posts/2026-04-08-webpack-5-106.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Explore what's new in this release:

## Plugin Validation with `compiler.hooks.validate`

Webpack adds a new top-level `validate` option and a [`compiler.hooks.validate`](/api/compiler-hooks/#validate) hook that standardize how schema validation works across webpack configuration, plugins, and loaders.
Webpack adds a new top-level `validate` option and a [`compiler.hooks.validate`](/docs/api/compilation/Compiler#validate) hook that standardize how schema validation works across webpack configuration, plugins, and loaders.

Until now, there was no unified way for plugins to integrate schema validation into the webpack build lifecycle. Each plugin handled validation on its own. The new `compiler.hooks.validate` hook gives plugin authors a standard API to register their validation logic, and `compiler.validate(...)` to run it. This means all validation from webpack's core config to every plugin that adopts the hook is controlled by a single `validate` flag and follows the same patterns:

Expand Down
6 changes: 1 addition & 5 deletions pages/blog/posts/2026-05-19-webpack-5-107.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ The comment value is parsed with the same context the JS and CSS parsers use, so
> [!WARNING]
> **This feature is experimental and depends on a recent Node.js.** It requires Node.js 22.6 or later for the stable `module.stripTypeScriptTypes` API. The transform handles only erasable TypeScript syntax (see limitations below). For anything else, keep using `ts-loader` or `swc-loader`.

Webpack 5.107 adds first-class TypeScript support behind a new `experiments.typescript` flag. With it enabled, webpack compiles `.ts`, `.cts`, and `.mts` files directly through Node.js's built-in [`module.stripTypeScriptTypes`](https://nodejs.org/api/module.html#modulestriptypescripttypescode-options), no external loader required. The flag is also turned on automatically by [`experiments.futureDefaults`](/configuration/experiments/#experimentsfuturedefaults).
Webpack 5.107 adds first-class TypeScript support behind a new `experiments.typescript` flag. With it enabled, webpack compiles `.ts`, `.cts`, and `.mts` files directly through Node.js's built-in [`module.stripTypeScriptTypes`](https://nodejs.org/api/module.html#modulestriptypescripttypescode-options), no external loader required. The flag is also turned on automatically by [`experiments.futureDefaults`](/docs/api/options#experimentsfuturedefaults).

```js
// webpack.config.js
Expand Down Expand Up @@ -437,8 +437,6 @@ One related improvement: the same external imported with two different phases (o

Webpack now supports the [`#__NO_SIDE_EFFECTS__`](https://github.com/javascript-compiler-hints/compiler-notations-spec/blob/main/no-side-effects-notation-spec.md#2-const-variable-declaration) annotation to mark functions as pure for better tree shaking. Calls to functions annotated this way can be eliminated from the bundle when their return value is unused, even if the function body is not statically analyzable as pure.

{/_ eslint-disable _/}

```js
// utils.js
/*#__NO_SIDE_EFFECTS__*/
Expand All @@ -451,8 +449,6 @@ export function realWork() {
}
```

{/_ eslint-enable _/}

```js
// app.js
import { createLogger, realWork } from './utils';
Expand Down
Loading
Loading