I have some config like this:
module.exports = {
...
devServer: {
contentBase: "./static",
proxy: {
"/": { ... },
},
},
};
This works well with webpack outputs, but not files in contentBase.
Is there anyway let it work?
你的配置错了,需要配置一个
devServer: {
publicPath: '/static/dist', //这个地址必须与服务端地址相同,才能从内存中获取
proxy: {
'/': {
target: 'xxxxx.com',
secure: false
}
}
}
Translation of @1021683053 's comment: "Your configuration is wrong, need to configure one" and
// This address must be the same as the server address in order to be retrieved from memory
Looks like that's a solid workaround.