I have added the devServer proxy target as
devServer: { proxy: { '^/': { target: 'https://xmlpi-ea.dhl.com/', ws: true, changeOrigin: true } } }
But it doesn't work when I build using npm run build, is there any solution?
This is for production not for development.
npm run build
If you are using vue-cli, you can use the following command to spin up your development server npm run serve
npm run serve
This is for production not for development.
If you are using vue-cli, you can use the following command to spin up your development server
npm run serve