--proxy-config option missing in new ng e2e
Versions
cli 6.0.0-rc.4
Repro steps
npm i @angular/cli@next -gng new helloworld- add
--proxy-config proxy.config.jsonto npme2escript inpackage.json cd helloworldnpm run e2e
Observed behavior
Unknown option: '--proxyConfig'
Desired behavior
ng e2e should continue to support a proxy config as before.
Mention any other details that might be useful (optional)
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.