facebook / facebook/docusaurus

Webpack dev server does NOT hot reload (affecting swizzle aliases, prism...)

オープン
#10,238 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug domain: dx
主要言語
TypeScript
スター
66.2k
フォーク
10k
平均マージ
1日 3時間
マージ済み PR(30日)
52

説明

### Description

As far as I know, to this day, it is not possible to update Webpack Dev Server config while the dev server is running (https://github.com/webpack/webpack-cli/issues/15)

Unfortunately, we need this for Docusaurus, otherwise there are many situations requiring users to restart the Docusaurus dev server (`docusaurus start`), notably:
- `docusaurus swizzle` modifies Webpack aliases, affecting module resolution (see my comment https://github.com/facebook/docusaurus/pull/10236#issuecomment-2180404988)
- Adding additional `prism` syntax highlighting language (see https://github.com/facebook/docusaurus/issues/7913)
- Any other Docusaurus config change affecting the Webpack config (in particular plugins using `configureWebpack`)

If no solution is provided by Webpack, we may need to stop/recreate the dev server ourselves in cases we are able to detect. Detecting aliases changes might be the lowest hanging fruit to implement.

### Steps to reproduce

Swizzle any component while the dev server is running: the new swizzled copy is added to your site but if you modify it nothing happens. This is because Webpack is still loading the original files. Webpack should load the new swizzled files

### Your environment

- Docusaurus version used: 3.4

### Self-service

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。