facebook / facebook/docusaurus

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

未关闭
#9,655 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug status: needs triage
主要语言
TypeScript
星标
66.2k
派生
10k
平均合并
1 天 3 小时
30 天内合并 PR
52

描述

### 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。