facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
54.07k stars 8.1k forks source link

Webpack dev server config does not hot reload (swizzle, #10238

Open slorber opened 1 week ago

slorber commented 1 week ago

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:

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

Self-service