File tree 2 files changed +7
-4
lines changed
packages/@angular/cli/lib/base-href-webpack
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export class BaseHrefWebpackPlugin {
26
26
} else {
27
27
// Replace only href attribute if exists
28
28
const modifiedBaseTag = baseTagMatches [ 0 ] . replace (
29
- / h r e f = " \S + " / i, `href="${ this . options . baseHref } "`
29
+ / h r e f = " \S * ? " / i, `href="${ this . options . baseHref } "`
30
30
) ;
31
31
htmlPluginData . html = htmlPluginData . html . replace ( baseTagRegex , modifiedBaseTag ) ;
32
32
}
Original file line number Diff line number Diff line change 1
- import { ng } from '../../utils/process' ;
2
- import { expectFileToMatch } from '../../utils/fs' ;
3
- import { updateJsonFile } from '../../utils/project' ;
1
+ import { ng } from '../../utils/process' ;
2
+ import { expectFileToMatch , replaceInFile } from '../../utils/fs' ;
3
+ import { updateJsonFile } from '../../utils/project' ;
4
4
5
5
6
6
export default function ( ) {
@@ -12,4 +12,7 @@ export default function() {
12
12
} ) )
13
13
. then ( ( ) => ng ( 'build' ) )
14
14
. then ( ( ) => expectFileToMatch ( 'dist/index.html' , / < b a s e h r e f = " \/ m y U r l " > / ) )
15
+ . then ( ( ) => replaceInFile ( 'src/index.html' , 'href="/"' , 'href=""' ) )
16
+ . then ( ( ) => ng ( 'build' ) )
17
+ . then ( ( ) => expectFileToMatch ( 'dist/index.html' , / < b a s e h r e f = " \/ m y U r l " > / ) ) ;
15
18
}
You can’t perform that action at this time.
0 commit comments