feat(app): add grunt-angular-templates to the build · yeoman/generator-angular@b7b72b0

@@ -317,12 +317,16 @@ module.exports = function (grunt) {

317317

usemin: {

318318

html: ['<%%= yeoman.dist %>/{,*/}*.html'],

319319

css: ['<%%= yeoman.dist %>/styles/{,*/}*.css'],

320+

js: ['<%%= yeoman.dist %>/scripts/{,*/}*.js'],

320321

options: {

321322

assetsDirs: [

322323

'<%%= yeoman.dist %>',

323324

'<%%= yeoman.dist %>/images',

324325

'<%%= yeoman.dist %>/styles'

325-

]

326+

],

327+

patterns: {

328+

js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]

329+

}

326330

}

327331

},

328332

@@ -386,12 +390,25 @@ module.exports = function (grunt) {

386390

files: [{

387391

expand: true,

388392

cwd: '<%%= yeoman.dist %>',

389-

src: ['*.html', 'views/{,*/}*.html'],

393+

src: ['*.html'],

390394

dest: '<%%= yeoman.dist %>'

391395

}]

392396

}

393397

},

394398399+

ngtemplates: {

400+

dist: {

401+

options: {

402+

module: '<%= scriptAppName %>',

403+

htmlmin: '<%%= htmlmin.dist.options %>',

404+

usemin: 'scripts/scripts.js'

405+

},

406+

cwd: '<%%= yeoman.app %>',

407+

src: 'views/{,*/}*.html',

408+

dest: 'templateCache.js'

409+

}

410+

},

411+395412

// ng-annotate tries to make the code safe for minification automatically

396413

// by using the Angular long form for dependency injection.

397414

ngAnnotate: {

@@ -424,7 +441,6 @@ module.exports = function (grunt) {

424441

'*.{ico,png,txt}',

425442

'.htaccess',

426443

'*.html',

427-

'views/{,*/}*.html',

428444

'images/{,*/}*.{webp}',

429445

'styles/fonts/{,*/}*.*'

430446

]

@@ -524,6 +540,7 @@ module.exports = function (grunt) {

524540

'useminPrepare',

525541

'concurrent:dist',

526542

'autoprefixer',

543+

'ngtemplates',

527544

'concat',

528545

'ngAnnotate',

529546

'copy:dist',