@@ -363,7 +363,7 @@ module.exports = function (grunt) {
363363 // concat, minify and revision files. Creates configurations in memory so
364364 // additional tasks can operate on them
365365 useminPrepare: {
366- html : '<%%= yeoman.app %>/index.html' ,
366+ html : '<%%= yeoman.dist %>/index.html' ,
367367 options : {
368368 dest : '<%%= yeoman.dist %>' ,
369369 flow : {
@@ -391,6 +391,17 @@ module.exports = function (grunt) {
391391 ] ,
392392 patterns : {
393393 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+ }
394405 }
395406 }
396407 } ,
@@ -495,6 +506,14 @@ module.exports = function (grunt) {
495506
496507 // Copies remaining files to places other tasks can use
497508 copy : {
509+ html : {
510+ files : [ {
511+ expand : true ,
512+ cwd : '<%= yeoman.app %>' ,
513+ src : '*.html' ,
514+ dest : '<%= yeoman.dist %>' ,
515+ } ] ,
516+ } ,
498517 dist : {
499518 files : [ {
500519 expand : true ,
@@ -503,7 +522,6 @@ module.exports = function (grunt) {
503522 dest : '<%%= yeoman.dist %>' ,
504523 src : [
505524 '*.{ico,png,txt}' ,
506- '*.html' ,
507525 'images/{,*/}*.{webp}' ,
508526 'styles/fonts/{,*/}*.*'
509527 ]
@@ -606,14 +624,15 @@ module.exports = function (grunt) {
606624 'clean:dist',
607625 'wiredep',< % if ( typescript ) { % >
608626 'tsd:refresh',< % } % >
627+ 'copy:html',
628+ 'cdnify',
609629 'useminPrepare',
610630 'concurrent:dist',
611631 'postcss',
612632 'ngtemplates',
613633 'concat',
614634 'ngAnnotate',
615635 'copy:dist',
616- 'cdnify',
617636 'cssmin',
618637 'uglify',
619638 'filerev',
0 commit comments