File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
packages/angular_devkit/build_angular Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
227
227
disableHostCheck : options . disableHostCheck ,
228
228
publicPath : servePath ,
229
229
hot : options . hmr ,
230
+ contentBase : false ,
230
231
} ;
231
232
232
233
if ( options . ssl ) {
Original file line number Diff line number Diff line change @@ -34,4 +34,16 @@ describe('Dev Server Builder', () => {
34
34
take ( 1 ) ,
35
35
) . toPromise ( ) . then ( done , done . fail ) ;
36
36
} , 30000 ) ;
37
+
38
+ it ( `doesn't serve files on the cwd directly` , async ( ) => {
39
+ const res = await runTargetSpec ( host , devServerTargetSpec ) . pipe (
40
+ tap ( ( buildEvent ) => expect ( buildEvent . success ) . toBe ( true ) ) ,
41
+ // When webpack-dev-server doesn't have `contentBase: false`, this will serve the repo README.
42
+ concatMap ( ( ) => from ( request ( 'http://localhost:4200/README.md' ) ) ) ,
43
+ take ( 1 ) ,
44
+ ) . toPromise ( ) ;
45
+
46
+ expect ( res ) . not . toContain ( 'This file is automatically generated during release.' ) ;
47
+ expect ( res ) . toContain ( '<title>HelloWorldApp</title>' ) ;
48
+ } ) ;
37
49
} ) ;
You can’t perform that action at this time.
0 commit comments