Skip to content

Commit 4960d84

Browse files
authored
fix(guides): resolve few more TODOs links (#177)
fix(guides): resolve few more TODOs links
1 parent 61f89c1 commit 4960d84

15 files changed

Lines changed: 23 additions & 23 deletions

File tree

pages/guides/core-workflows/development/hot-module-replacement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ try {
203203
}
204204
```
205205
206-
See the [full documentation of the `webpack-dev-server` Node.js API](#TODO[/api/webpack-dev-server/]).
206+
See the [full documentation of the `webpack-dev-server` Node.js API](https://github.com/webpack/webpack-dev-server#with-the-api).
207207
208208
> [!TIP]
209209
> If you're [using `webpack-dev-middleware`](/guides/core-workflows/development/#using-webpack-dev-middleware), check out the [`webpack-hot-middleware`](https://github.com/webpack/webpack-hot-middleware) package to enable HMR on your custom dev server.

pages/guides/core-workflows/environment-variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ To distinguish between [development](/guides/core-workflows/development) and [pr
99
> [!TIP]
1010
> webpack's environment variables are different from the [environment variables](https://en.wikipedia.org/wiki/Environment_variable) of operating system shells such as `bash` and `CMD.exe`.
1111
12-
The webpack command line [environment option](#TODO[/api/cli/#environment-options]) `--env` lets you pass in as many environment variables as you like, and they're then made available in your `webpack.config.js`. For example, `--env production` or `--env goal=local`.
12+
The webpack command line [environment option](https://github.com/webpack/webpack-cli/blob/main/packages/webpack-cli/README.md#available-options) `--env` lets you pass in as many environment variables as you like, and they're then made available in your `webpack.config.js`. For example, `--env production` or `--env goal=local`.
1313

1414
```bash
1515
npx webpack --env goal=local --env production --progress
1616
```
1717

1818
> [!TIP]
19-
> Setting an `env` variable without an assignment, such as `--env production`, sets `env.production` to `true` by default. Other syntaxes are also available. See the [webpack CLI](#TODO[/api/cli/#environment-options]) documentation for more information.
19+
> Setting an `env` variable without an assignment, such as `--env production`, sets `env.production` to `true` by default. Other syntaxes are also available. See the [webpack CLI](https://github.com/webpack/webpack-cli/blob/main/packages/webpack-cli/README.md#available-options) documentation for more information.
2020
2121
You'll need to make one change to your webpack config. Typically, `export default` points directly to the configuration object. To use the `env` variable, you must make `export default` a function instead:
2222

@@ -43,4 +43,4 @@ export default env => {
4343
```
4444
4545
> [!TIP]
46-
> The webpack CLI provides some [built-in environment variables](#TODO[/api/cli/#cli-environment-variables]) that you can access inside a webpack configuration.
46+
> The webpack CLI provides some [built-in environment variables](https://github.com/webpack/webpack-cli/blob/main/packages/webpack-cli/README.md#cli-environment-variables) that you can access inside a webpack configuration.

pages/guides/core-workflows/output-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Run `npm run build` again and inspect the `/dist` folder. If everything went wel
216216

217217
You might wonder how webpack and its plugins seem to "know" which files are being generated. The answer lies in the manifest that webpack keeps to track how all the modules map to the output bundles. If you're interested in managing webpack's [`output`](#TODO[/configuration/output]) in other ways, the manifest is a good place to start.
218218

219-
The manifest data can be extracted into a JSON file for consumption using the [`ManifestPlugin`](#TODO[/plugins/manifest-plugin/]).
219+
The manifest data can be extracted into a JSON file for consumption using the [`ManifestPlugin`](/docs/api/plugins/ManifestPlugin).
220220

221221
We won't walk through a full example of using this plugin in your project, but you can read the [concept page](/guides/getting-started/concepts/manifest) and the [caching guide](/guides/optimization/caching) to learn how this ties into long-term caching.
222222

pages/guides/getting-started/concepts/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use these capabilities whenever they make sense.
1818

1919
The following practices, while technically possible, are best avoided:
2020

21-
- Reading CLI arguments directly when using the webpack CLI. Doing so makes your configuration less portable and harder to maintain. Instead, write your own CLI or [use `--env`](#TODO[/api/cli/#env]) to pass environment variables.
21+
- Reading CLI arguments directly when using the webpack CLI. Doing so makes your configuration less portable and harder to maintain. Instead, write your own CLI or [use `--env`](/guides/core-workflows/environment-variables) to pass environment variables.
2222
- Exporting non-deterministic values. Running webpack twice should always produce the same output files.
2323
- Writing long configurations. Split a large configuration into multiple files instead.
2424

pages/guides/getting-started/concepts/hot-module-replacement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ HMR is an opt-in feature that only affects modules containing HMR code. One exam
4242

4343
Similarly, by implementing the HMR interface in a module, you can describe what should happen when that module is updated. In most cases, however, you do not need to write HMR code in every module. If a module has no HMR handlers, the update bubbles up. This means a single handler can update a whole module tree. When any module in the tree is updated, the entire set of dependencies is reloaded.
4444

45-
See the [HMR API page](#TODO[/api/hot-module-replacement]) for details on the `module.hot` interface.
45+
See the [HMR guide](/guides/core-workflows/development/hot-module-replacement) for details on using the `module.hot` interface.
4646

4747
### In the runtime
4848

49-
Here things get a bit more technical. If you're not interested in the internals, feel free to skip ahead to the [HMR API page](#TODO[/api/hot-module-replacement]) or the [HMR guide](/guides/core-workflows/development/hot-module-replacement).
49+
Here things get a bit more technical. If you're not interested in the internals, feel free to skip ahead to the [HMR guide](/guides/core-workflows/development/hot-module-replacement).
5050

5151
For the module system runtime, additional code is emitted to track each module's `parents` and `children`. On the management side, the runtime supports two methods: `check` and `apply`.
5252

pages/guides/getting-started/concepts/loaders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default {
6969

7070
### Inline
7171

72-
You can specify loaders directly in an `import` statement, or in any [equivalent "importing" method](#TODO[/api/module-methods]). Separate loaders from the resource with `!`. Each part is resolved relative to the current directory.
72+
You can specify loaders directly in an `import` statement, or in any equivalent "importing" method. Separate loaders from the resource with `!`. Each part is resolved relative to the current directory.
7373

7474
> [!TIP]
7575
> The `loader1!loader2!./file` syntax is shown here only for illustration. In most projects, prefer configuring loaders via `module.rules` and importing styles for their side effects (for example, `import "./styles.css"`).
@@ -119,4 +119,4 @@ Loaders let you customize the output through their preprocessing functions. This
119119

120120
Loaders follow the standard [module resolution](/guides/getting-started/concepts/module-resolution). In most cases they are loaded from the [module path](/guides/getting-started/concepts/module-resolution/#module-paths) (think `npm install` and `node_modules`).
121121

122-
A loader module is expected to export a function and be written in Node.js-compatible JavaScript. Loaders are most commonly managed with npm, but you can also keep custom loaders as files within your application. By convention, loaders are usually named `xxx-loader` (for example, `json-loader`). See [Writing a Loader](#TODO[/contribute/writing-a-loader/]) for more information.
122+
A loader module is expected to export a function and be written in Node.js-compatible JavaScript. Loaders are most commonly managed with npm, but you can also keep custom loaders as files within your application. By convention, loaders are usually named `xxx-loader` (for example, `json-loader`).

pages/guides/getting-started/concepts/manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The runtime, together with the manifest data, is all the code webpack needs to w
2020

2121
Once your application reaches the browser as an `index.html` file, some bundles and a variety of other assets must be loaded and linked together somehow. That `/src` directory you carefully laid out is now bundled, minified, and maybe even split into smaller chunks for lazy-loading by webpack's [`optimization`](#TODO[/configuration/optimization/]). So how does webpack manage the interaction between all of your required modules? This is where the manifest data comes in.
2222

23-
As the compiler enters, resolves, and maps out your application, it keeps detailed notes on all of your modules. This collection of data is called the "manifest," and it's what the runtime uses to resolve and load modules once they've been bundled and shipped to the browser. No matter which [module syntax](#TODO[/api/module-methods]) you chose, those `import` and `require` statements have now become `__webpack_require__` methods that point to module identifiers. Using the data in the manifest, the runtime can find out where to retrieve the modules behind those identifiers.
23+
As the compiler enters, resolves, and maps out your application, it keeps detailed notes on all of your modules. This collection of data is called the "manifest," and it's what the runtime uses to resolve and load modules once they've been bundled and shipped to the browser. No matter which module syntax you chose, those `import` and `require` statements have now become `__webpack_require__` methods that point to module identifiers. Using the data in the manifest, the runtime can find out where to retrieve the modules behind those identifiers.
2424

2525
## The problem
2626

pages/guides/getting-started/concepts/module-federation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ publicPath.set('/your-public-path');
231231

232232
### Infer the public path from the script
233233

234-
You can infer the public path from the script tag via `document.currentScript.src` and set it with the [`__webpack_public_path__`](#TODO[/api/module-variables/#__webpack_public_path__-webpack-specific]) module variable at runtime.
234+
You can infer the public path from the script tag via `document.currentScript.src` and set it with the [`__webpack_public_path__`](/guides/getting-started/concepts/output/#advanced) module variable at runtime.
235235

236236
Example:
237237

pages/guides/getting-started/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors: bebraw,varunjayaraman,cntanglijun,chrisVillanueva,johnstew,simon04,aaro
66

77
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.
88

9-
webpack is used to efficiently compile JavaScript modules. Once [installed](/guides/getting-started/installing-webpack), you can interact with webpack through either its [CLI](#TODO[/api/cli]) or its [API](#TODO[/api/node]). If you're new to webpack, please read through the [core concepts](/guides/getting-started/concepts) and [this comparison](#TODO[/comparison]) to learn why you might choose it over the other tools available in the community.
9+
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](#TODO[/api/node]). 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.
1010

1111
> [!WARNING]
1212
> The examples in this guide use `webpack-cli` 7, which requires Node.js 20.9.0 or later.
@@ -23,7 +23,7 @@ cd webpack-demo
2323
```
2424

2525
> [!TIP]
26-
> Need a CLI-based project setup or templates? See the [Init command](#TODO[/api/cli/#init]) for webpack's scaffolding flow.
26+
> Need a CLI-based project setup or templates? See the [Init command](https://github.com/webpack/webpack-cli/tree/main/packages/create-webpack-app) for webpack's scaffolding flow.
2727
2828
> [!TIP]
2929
> This command generates a ready-to-use webpack project with a sensible default configuration. Continue below if you'd like to understand how to set up webpack manually, step by step.
@@ -245,9 +245,9 @@ Open `index.html` from the `dist` directory in your browser, and if everything w
245245

246246
The [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) and [`export`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) statements were standardized in [ES2015](https://babeljs.io/docs/en/learn/). They are supported in most browsers today, though some browsers don't recognize the new syntax. Don't worry, though: webpack supports them out of the box.
247247

248-
Behind the scenes, webpack analyzes your module graph and bundles the modules into code the browser can load in the right order. It handles module syntax such as `import` and `export`, and supports various other module syntaxes as well. See [Module API](#TODO[/api/module-methods]) for more information.
248+
Behind the scenes, webpack analyzes your module graph and bundles the modules into code the browser can load in the right order. It handles module syntax such as `import` and `export`, and supports various other module syntaxes as well.
249249

250-
Note that webpack will not alter any code other than `import` and `export` statements. If you're using other [ES2015 features](http://es6-features.org/), make sure to [use a transpiler](#TODO[/loaders/#transpiling]) such as [Babel](https://babeljs.io/) via webpack's [loader system](/guides/getting-started/concepts/loaders).
250+
Note that webpack will not alter any code other than `import` and `export` statements. If you're using other [ES2015 features](http://es6-features.org/), make sure to use a transpiler such as [Babel](https://babeljs.io/) via webpack's [loader system](/guides/getting-started/concepts/loaders).
251251

252252
## Using a configuration
253253

pages/guides/getting-started/installing-webpack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ npm install --save-dev webpack@<version>
2727
> [!TIP]
2828
> Whether to use `--save-dev` depends on your use case. If you use webpack only for bundling, installing it with `--save-dev` is recommended, since you won't include webpack in your production build. Otherwise, you can omit `--save-dev`.
2929
30-
If you're using webpack v4 or later and want to call `webpack` from the command line, you'll also need to install the [CLI](#TODO[/api/cli/]):
30+
If you're using webpack v4 or later and want to call `webpack` from the command line, you'll also need to install the [CLI](https://github.com/webpack/webpack-cli#how-to-install):
3131

3232
```bash
3333
npm install --save-dev webpack-cli

0 commit comments

Comments
 (0)