File tree 2 files changed +32
-1
lines changed
packages/angular_devkit/build_angular
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export interface DevServerBuilderOptions {
55
55
vendorChunk ?: boolean ;
56
56
commonChunk ?: boolean ;
57
57
baseHref ?: string ;
58
+ deployUrl ?: string ;
58
59
progress ?: boolean ;
59
60
poll ?: number ;
60
61
verbose ?: boolean ;
@@ -333,7 +334,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
333
334
let servePath = options . servePath ;
334
335
if ( ! servePath && servePath !== '' ) {
335
336
const defaultServePath =
336
- this . _findDefaultServePath ( browserOptions . baseHref , browserOptions . deployUrl ) ;
337
+ this . _findDefaultServePath ( browserOptions . baseHref , options . deployUrl ) ;
337
338
const showWarning = options . servePathDefaultWarning ;
338
339
if ( defaultServePath == null && showWarning ) {
339
340
this . context . logger . warn ( tags . oneLine `
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+
9
+ import { request , runTargetSpec } from '@angular-devkit/architect/testing' ;
10
+ import { from } from 'rxjs' ;
11
+ import { concatMap , take , tap } from 'rxjs/operators' ;
12
+ import { DevServerBuilderOptions } from '../../src' ;
13
+ import { devServerTargetSpec , host } from '../utils' ;
14
+
15
+
16
+ describe ( 'Dev Server Deploy Url' , ( ) => {
17
+ beforeEach ( done => host . initialize ( ) . toPromise ( ) . then ( done , done . fail ) ) ;
18
+ afterEach ( done => host . restore ( ) . toPromise ( ) . then ( done , done . fail ) ) ;
19
+
20
+ it ( 'works' , ( done ) => {
21
+ const overrides : Partial < DevServerBuilderOptions > = { deployUrl : 'test/' } ;
22
+
23
+ runTargetSpec ( host , devServerTargetSpec , overrides ) . pipe (
24
+ tap ( ( buildEvent ) => expect ( buildEvent . success ) . toBe ( true ) ) ,
25
+ concatMap ( ( ) => from ( request ( 'http://localhost:4200/test/polyfills.js' ) ) ) ,
26
+ tap ( response => expect ( response ) . toContain ( 'window["webpackJsonp"]' ) ) ,
27
+ take ( 1 ) ,
28
+ ) . toPromise ( ) . then ( done , done . fail ) ;
29
+ } , 30000 ) ;
30
+ } ) ;
You can’t perform that action at this time.
0 commit comments