-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Command
serve
Description
We are in the process of migrating from using webpack to esbuild/vite.
For development purposes, we need a way to dynamically switch from one theme to another. At this point, we have achieved it by proxying CSS or image files depending on the host name.
After switching to Vite, it turned out that it could work the same, apart from the fact that for CSS resources, our middleware is never executed.
I found a piece of code that seems to be the root cause. The AngularMemoryPlugin handles CSS files in a specific way and never executes next(), which terminates the middleware chain.
angular-cli/packages/angular_devkit/build_angular/src/tools/vite/angular-memory-plugin.ts
Lines 163 to 178 in 3d7b5f7
Describe the solution you'd like
Ideally middleware chain should not be terminated in AngularMemoryPlugin for stylesheets (ie. next() should be called)
Describe alternatives you've considered
In the worst case scenario, we will find another solution for our use case. However, since the issue only pertains to CSS files, it would be really helpful if the middleware is executed for these files as well.