Description
Expected Behavior
Static serving middleware for the dev server should only need to be applied to the express server once via this.app.use(...)
Actual Behavior
static middleware is applied to the express server multiple times in order to make historyApiFallback
work as expected. This is explained here: #2670 (comment)
A similar thing seems to have been added for the middleware
feature as seen here, as it is added multiple times:
webpack-dev-server/lib/Server.js
Lines 548 to 559 in 4ab1f21
Solution
We need to find a way to either apply all of this middleware once without having any breaking changes, or have intentional slight breaking changes while only applying the middleware once. We should also look into if applying the same middleware many times causes performance losses, or if it is an acceptable thing to do.