facebook / facebook/docusaurus

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

Đang mở
#9,655 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug status: needs triage
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.