File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
packages/@angular/cli/commands Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,11 @@ const BuildCommand = Command.extend({
239
239
commandOptions . forceTsCommonjs = true ;
240
240
}
241
241
242
+ // Add trailing slash if missing to prevent https://github.com/angular/angular-cli/issues/7295
243
+ if ( commandOptions . deployUrl && commandOptions . deployUrl . substr ( - 1 ) !== '/' ) {
244
+ commandOptions . deployUrl += '/' ;
245
+ }
246
+
242
247
const BuildTask = require ( '../tasks/build' ) . default ;
243
248
244
249
const buildTask = new BuildTask ( {
Original file line number Diff line number Diff line change @@ -27,5 +27,11 @@ export default function () {
27
27
// verify --deploy-url is applied to non-extracted css urls
28
28
. then ( ( ) => ng ( 'build' , '--deploy-url=deployUrl/' , '--extract-css=false' ) )
29
29
. then ( ( ) => expectFileToMatch ( 'dist/styles.bundle.js' ,
30
- / _ _ w e b p a c k _ r e q u i r e _ _ .p \+ \" m o r e \. [ 0 - 9 a - f ] { 20 } \. p n g \" / ) ) ;
30
+ / _ _ w e b p a c k _ r e q u i r e _ _ .p \+ \" m o r e \. [ 0 - 9 a - f ] { 20 } \. p n g \" / ) )
31
+ . then ( ( ) => expectFileToMatch ( 'dist/inline.bundle.js' ,
32
+ / _ _ w e b p a c k _ r e q u i r e _ _ \. p = " d e p l o y U r l \/ " ; / ) )
33
+ // verify slash is appended to the end of --deploy-url if missing
34
+ . then ( ( ) => ng ( 'build' , '--deploy-url=deployUrl' , '--extract-css=false' ) )
35
+ . then ( ( ) => expectFileToMatch ( 'dist/inline.bundle.js' ,
36
+ / _ _ w e b p a c k _ r e q u i r e _ _ \. p = " d e p l o y U r l \/ " ; / ) ) ;
31
37
}
You can’t perform that action at this time.
0 commit comments