简体   繁体   English

Angular 2 代理的 NPM Intellij IDEA 配置

[英]NPM Intellij IDEA configuration for Angular 2 proxy

I would like to configure Intellij IDEA to run 'on click' npm Angular 2 conf with proxy as argument.我想将 Intellij IDEA 配置为使用代理作为参数运行“点击”npm Angular 2 conf。 I can do it via terminal by command ng serve --proxy-config proxy.conf.json but more easily would by configuration done via Intellij.我可以通过终端通过命令ng serve --proxy-config proxy.conf.json但更容易通过 Intellij 完成配置。 When I paste my argument in input, I get only ng serve "proxy.conf.json . What is wrong with this?当我在输入中粘贴我的参数时,我只得到ng serve "proxy.conf.json 。这有什么问题?

我现在的配置

Ok, so one of the solutions is to add new script to package.json under scripts like "local-run-with-proxy": "ng serve --proxy-config proxy.conf.json".好了,解决办法之一是新的脚本下增加的package.json scripts ,如“本地运行与代理”:“NG服务--proxy-配置proxy.conf.json”。 Then create NPM configuration with a paramater scripts as local-run-with-proxy.然后使用参数scripts创建 NPM 配置作为 local-run-with-proxy。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM