Passing an Array to devServer.proxy is not supported.
It can be used to proxy multiple, specific paths to the same target.
https://webpack.js.org/configuration/dev-server/#devserver-proxy
module.exports = {
//...
devServer: {
proxy: [{
context: ['/auth', '/api'],
target: 'http://localhost:3000',
}]
}
};
You can get equivalent functionality via:
{
proxy: {
...['/auth', '/api'].reduce(
(acc, ctx) => ({
...acc,
[ctx]: { target: 'http://localhost:3000' },
}),
{}
),
},
},
Most helpful comment
You can get equivalent functionality via: