Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问webpack的代理怎么设置 #30

Closed
SoraYao opened this issue Dec 12, 2017 · 1 comment
Closed

请问webpack的代理怎么设置 #30

SoraYao opened this issue Dec 12, 2017 · 1 comment

Comments

@SoraYao
Copy link

SoraYao commented Dec 12, 2017

在webpack.config.dev.js中添加了代理的相关设置,但是在测试环境中每次fetch的时候 请求地址还是没有成功代理,

devServer: { historyApiFallback: true, host: 'localhost', port: '3006', hot: true, inline: true, stats: { colors: true }, proxy: { '/api/*': { target: 'http://XXXXX', pathRewrite: {'^/api' : '/api'}, changeOrigin: true } } },

@yezihaohao
Copy link
Owner

yezihaohao commented Dec 12, 2017

可以直接设置package.json.#12 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants