File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 7979 "type" : " string" ,
8080 "description" : " URL where files will be deployed."
8181 },
82+ "baseHref" : {
83+ "type" : " string" ,
84+ "description" : " Base url for the application being built."
85+ },
8286 "index" : {
8387 "type" : " string" ,
8488 "default" : " index.html" ,
Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ export class NgCliWebpackConfig {
9797 public mergeConfigs ( buildOptions : BuildOptions , appConfig : any ) {
9898 const mergeableOptions = {
9999 outputPath : appConfig . outDir ,
100- deployUrl : appConfig . deployUrl
100+ deployUrl : appConfig . deployUrl ,
101+ baseHref : appConfig . baseHref
101102 } ;
102103
103104 return Object . assign ( { } , mergeableOptions , buildOptions ) ;
Original file line number Diff line number Diff line change 11import { ng } from '../../utils/process' ;
22import { expectFileToMatch } from '../../utils/fs' ;
33import { getGlobalVariable } from '../../utils/env' ;
4+ import { updateJsonFile } from '../../utils/project' ;
45
56
67export default function ( ) {
@@ -10,5 +11,11 @@ export default function() {
1011 }
1112
1213 return ng ( 'build' , '--base-href' , '/myUrl' )
13- . then ( ( ) => expectFileToMatch ( 'dist/index.html' , / < b a s e h r e f = " \/ m y U r l " > / ) ) ;
14+ . then ( ( ) => expectFileToMatch ( 'dist/index.html' , / < b a s e h r e f = " \/ m y U r l " > / ) )
15+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
16+ const app = configJson [ 'apps' ] [ 0 ] ;
17+ app [ 'baseHref' ] = '/myUrl' ;
18+ } ) )
19+ . then ( ( ) => ng ( 'build' ) )
20+ . then ( ( ) => expectFileToMatch ( 'dist/index.html' , / < b a s e h r e f = " \/ m y U r l " > / ) )
1421}
You can’t perform that action at this time.
0 commit comments