diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 049c2b5e..976ed0c5 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -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 diff --git a/pages/docs/index.md b/pages/docs/index.md index 67ced94f..b9e80713 100644 --- a/pages/docs/index.md +++ b/pages/docs/index.md @@ -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. diff --git a/pages/docs/plugins/index.md b/pages/docs/plugins/index.md index a74a4e11..a7f31f7c 100644 --- a/pages/docs/plugins/index.md +++ b/pages/docs/plugins/index.md @@ -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 | diff --git a/pages/guides/contributing/debugging.md b/pages/guides/contributing/debugging.md index d779ecf9..3b27cb62 100644 --- a/pages/guides/contributing/debugging.md +++ b/pages/guides/contributing/debugging.md @@ -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. diff --git a/pages/guides/contributing/writers-guide.md b/pages/guides/contributing/writers-guide.md index 0ffb8409..b6aa9205 100644 --- a/pages/guides/contributing/writers-guide.md +++ b/pages/guides/contributing/writers-guide.md @@ -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. diff --git a/pages/guides/contributing/writing-a-loader.md b/pages/guides/contributing/writing-a-loader.md index 643b0794..2dd66747 100644 --- a/pages/guides/contributing/writing-a-loader.md +++ b/pages/guides/contributing/writing-a-loader.md @@ -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 @@ -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 diff --git a/pages/guides/contributing/writing-a-plugin.md b/pages/guides/contributing/writing-a-plugin.md index 15c7903c..9a6beaa5 100644 --- a/pages/guides/contributing/writing-a-plugin.md +++ b/pages/guides/contributing/writing-a-plugin.md @@ -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. @@ -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 { @@ -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 @@ -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 diff --git a/pages/guides/getting-started/index.md b/pages/guides/getting-started/index.md index 2f01755a..8938dec5 100644 --- a/pages/guides/getting-started/index.md +++ b/pages/guides/getting-started/index.md @@ -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. diff --git a/pages/site.json b/pages/site.json index 7aa5e4f5..b9543d91 100644 --- a/pages/site.json +++ b/pages/site.json @@ -63,7 +63,7 @@ }, { "text": "API", - "link": "/docs/api/v5.x" + "link": "/docs/api" }, { "text": "Security Policy", diff --git a/vercel.json b/vercel.json index 3b397d6a..9ebe45d5 100644 --- a/vercel.json +++ b/vercel.json @@ -188,7 +188,7 @@ }, { "source": "/guides/public-path", - "destination": "/docs/api/v5.x/options#outputpublicpath", + "destination": "/docs/api/options#outputpublicpath", "permanent": false }, { @@ -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 }, {