cli 6.0.0-rc.4
npm i @angular/cli@next -gng new helloworld--proxy-config proxy.config.json to npm e2e script in package.jsoncd helloworldnpm run e2eUnknown option: '--proxyConfig'
ng e2e should continue to support a proxy config as before.
Works with ng serve.
Looks like ng e2e is now taking options directly from ng serve options. For info, you need to config your angular.json like this:
"serve": {
"options": {
"browserTarget": "appname:build",
"proxyConfig": "proxy.conf.json"
}
}
Hi @cyrilletuzi
I am not sure about latest version of Angular CLI, but in version 1.6.5 you can add a proxy to protractor by a command line like this:
(package.json)
"e2e": "ng e2e --proxy-config proxy.conf.json",
Not sure why it was not documented in the wiki, it looks like a 'natural' way of adding a proxy - similar to the ng serve.
You can also make a separate "option" in your angular.json like this:
"e2e": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "appname:build",
"proxyConfig": "src/proxy.conf.json"
}
}
for .angular-cli.json i added
"serve": {
"port": 4200,
"host": "localhost",
"proxyConfig": "./proxy.conf.json"
}
thanks @cyrilletuzi
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Looks like
ng e2eis now taking options directly fromng serveoptions. For info, you need to config yourangular.jsonlike this: