I have a Vue.JS project where a customization css is served by the backend. This can be configured using devServer.proxy
.
When the backend doesn't have a custom css to serve (reutrns 404), is there a way to fallback to serving a static file ? I tried:
devServer: {
proxy: {
'^/custom.css$': {
target: backend,
onError(err, req, res, target) { res.end(static_css) /* never called */ }
}
}
}
But onError is not called, so I may have misunderstood the doc but don't see any way to implement a fallback. Is is at all possible ?
I know I can implement this at some other level (e.g. in the browser or the backend), but this question is specifically about proxy fallback in webpack dev server.