diff --git a/packages/angular_devkit/build_angular/src/protractor/index.ts b/packages/angular_devkit/build_angular/src/protractor/index.ts index e4427bd254c3..0c80ad9689e2 100644 --- a/packages/angular_devkit/build_angular/src/protractor/index.ts +++ b/packages/angular_devkit/build_angular/src/protractor/index.ts @@ -58,8 +58,11 @@ export class ProtractorBuilder implements Builder { private _startDevServer(options: ProtractorBuilderOptions) { const architect = this.context.architect; const [project, targetName, configuration] = (options.devServerTarget as string).split(':'); - // Override browser build watch setting. - const overrides = { watch: false, host: options.host, port: options.port }; + // Override dev server watch setting. + const overrides: Partial = { watch: false }; + // Also override the port and host if they are defined in protractor options. + if (options.host !== undefined) { overrides.host = options.host; } + if (options.port !== undefined) { overrides.port = options.port; } const targetSpec = { project, target: targetName, configuration, overrides }; const builderConfig = architect.getBuilderConfiguration(targetSpec); let devServerDescription: BuilderDescription;