@@ -363,7 +363,7 @@ module.exports = function (grunt) {
363
363
// concat, minify and revision files. Creates configurations in memory so
364
364
// additional tasks can operate on them
365
365
useminPrepare: {
366
- html : '<%%= yeoman.app %>/index.html' ,
366
+ html : '<%%= yeoman.dist %>/index.html' ,
367
367
options : {
368
368
dest : '<%%= yeoman.dist %>' ,
369
369
flow : {
@@ -391,6 +391,17 @@ module.exports = function (grunt) {
391
391
] ,
392
392
patterns : {
393
393
js : [ [ / ( i m a g e s \/ [ ^ ' ' " " ] * \. ( p n g | j p g | j p e g | g i f | w e b p | s v g ) ) / g, 'Replacing references to images' ] ]
394
+ } ,
395
+ blockReplacements : {
396
+ // Include cdnified scripts followed by usemin dest script
397
+ js : function ( block ) {
398
+ var scripts = block . src . filter ( function ( src ) {
399
+ return src . startsWith ( '//' ) ;
400
+ } ) . concat ( block . dest ) ;
401
+ return scripts . map ( function ( src ) {
402
+ return '<script src="' + src + '"></script>' ;
403
+ } ) . join ( '\n' ) ;
404
+ }
394
405
}
395
406
}
396
407
} ,
@@ -495,6 +506,14 @@ module.exports = function (grunt) {
495
506
496
507
// Copies remaining files to places other tasks can use
497
508
copy : {
509
+ html : {
510
+ files : [ {
511
+ expand : true ,
512
+ cwd : '<%= yeoman.app %>' ,
513
+ src : '*.html' ,
514
+ dest : '<%= yeoman.dist %>' ,
515
+ } ] ,
516
+ } ,
498
517
dist : {
499
518
files : [ {
500
519
expand : true ,
@@ -503,7 +522,6 @@ module.exports = function (grunt) {
503
522
dest : '<%%= yeoman.dist %>' ,
504
523
src : [
505
524
'*.{ico,png,txt}' ,
506
- '*.html' ,
507
525
'images/{,*/}*.{webp}' ,
508
526
'styles/fonts/{,*/}*.*'
509
527
]
@@ -606,14 +624,15 @@ module.exports = function (grunt) {
606
624
'clean:dist',
607
625
'wiredep',< % if ( typescript ) { % >
608
626
'tsd:refresh',< % } % >
627
+ 'copy:html',
628
+ 'cdnify',
609
629
'useminPrepare',
610
630
'concurrent:dist',
611
631
'postcss',
612
632
'ngtemplates',
613
633
'concat',
614
634
'ngAnnotate',
615
635
'copy:dist',
616
- 'cdnify',
617
636
'cssmin',
618
637
'uglify',
619
638
'filerev',
0 commit comments