facebook / facebook/docusaurus

Plugins API: `beforeDevServer` and `afterDevServer` are documented, but don't exist

Offen
#9,655 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug status: needs triage
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### Description

https://docusaurus.io/docs/api/plugin-methods mentions `beforeDevServer` and `afterDevServer`. When I attempted to use these, I found I couldn't get them to do anything. A [quick search in GitHub](https://github.com/search?q=repo%3Afacebook%2Fdocusaurus+beforeDevServer&type=code) shows only results in `.mdx` files, so it appears to me like the API simply doesn't exist. [Searching for configureWebpack instead](https://github.com/search?q=repo%3Afacebook%2Fdocusaurus+configureWebpack&type=code), for example, brings up a bunch of results.

### Reproducible demo

https://codesandbox.io/p/devbox/examples-classic-b9y9z?file=%2Fdocusaurus.config.js

### Steps to reproduce

1. Run the dev server
2. Observe that `running beforeDevServer` isn't logged

### Expected behavior

I don't really know because it's completely broken, but I'd expect it to at least console.log when starting the dev server, like it does if I configure the plugin manually using `configureWebpack`.

### Actual behavior

Nothing is logged. I get no behaviour change.

### Your environment

_No response_

### Self-service

- [ ] I'd be willing to fix this bug myself.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.