Answer the question
In order to leave comments, you need to log in
Why doesn't proxy work in Webpack's devServer?
I'm trying to set up a dev build so that it sends and receives data from the prod server through a proxy in the Webpack dev server.
In the target key, I specify the address to which the proxy should replace requests to the server, but as a result, requests still go to the address of my localhost, which causes a 500 error to appear in the console. I can't figure out where the error is in the config file:
devServer: {
contentBase: commonWebpack.externals.path.src,
watchContentBase: true,
port: 8080,
open: true,
hot: true,
proxy: {
'/': {
target: 'http://mysite.ru',
changeOrigin: true
}
}
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question