@@ -44,7 +44,14 @@ export class ProtractorBuilder implements Builder<ProtractorBuilderOptions> {
4444 const options = builderConfig . options ;
4545 const root = this . context . workspace . root ;
4646 const projectRoot = resolve ( root , builderConfig . root ) ;
47- // const projectSystemRoot = getSystemPath(projectRoot);
47+
48+ // ensure that either one of this option is used
49+ if ( options . devServerTarget && options . baseUrl ) {
50+ throw new Error ( tags . stripIndents `
51+ The 'baseUrl' option cannot be used with 'devServerTarget'.
52+ When present, 'devServerTarget' will be used to automatically setup 'baseUrl' for Protractor.
53+ ` ) ;
54+ }
4855
4956 // TODO: verify using of(null) to kickstart things is a pattern.
5057 return of ( null ) . pipe (
@@ -81,7 +88,7 @@ export class ProtractorBuilder implements Builder<ProtractorBuilderOptions> {
8188 }
8289
8390 // Compute baseUrl from devServerOptions.
84- if ( options . devServerTarget && builderConfig . options . publicHost ) {
91+ if ( builderConfig . options . publicHost ) {
8592 let publicHost = builderConfig . options . publicHost ;
8693 if ( ! / ^ \w + : \/ \/ / . test ( publicHost ) ) {
8794 publicHost = `${ builderConfig . options . ssl
@@ -90,7 +97,7 @@ export class ProtractorBuilder implements Builder<ProtractorBuilderOptions> {
9097 }
9198 const clientUrl = url . parse ( publicHost ) ;
9299 baseUrl = url . format ( clientUrl ) ;
93- } else if ( options . devServerTarget ) {
100+ } else {
94101 const result : DevServerResult | undefined = buildEvent . result ;
95102
96103 baseUrl = url . format ( {
0 commit comments