File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/@angular/cli/lib/base-href-webpack Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export class BaseHrefWebpackPlugin {
2626 } else {
2727 // Replace only href attribute if exists
2828 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 } "`
3030 ) ;
3131 htmlPluginData . html = htmlPluginData . html . replace ( baseTagRegex , modifiedBaseTag ) ;
3232 }
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' ;
44
55
66export default function ( ) {
@@ -12,4 +12,7 @@ export default function() {
1212 } ) )
1313 . then ( ( ) => ng ( 'build' ) )
1414 . 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 " > / ) ) ;
1518}
You can’t perform that action at this time.
0 commit comments