facebook / facebook/docusaurus

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

未关闭
#10,238 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug domain: dx
主要语言
TypeScript
星标
66.2k
派生
10k
平均合并
1 天 3 小时
30 天内合并 PR
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 摘要。