Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

adding grunt-angular-templates to the build tasks #277

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ module.exports = function (grunt) {
usemin: {
html: ['<%%= yeoman.dist %>/{,*/}*.html'],
css: ['<%%= yeoman.dist %>/styles/{,*/}*.css'],
js: ['<%= yeoman.dist %>/scripts/{,*/}*.js'],
options: {
assetsDirs: ['<%%= yeoman.dist %>']
assetsDirs: ['<%%= yeoman.dist %>'],
patterns: {
js: [[/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images']]
}
}
},

Expand Down Expand Up @@ -307,7 +311,7 @@ module.exports = function (grunt) {
files: [{
expand: true,
cwd: '<%%= yeoman.dist %>',
src: ['*.html', 'views/{,*/}*.html'],
src: ['*.html'],
dest: '<%%= yeoman.dist %>'
}]
}
Expand Down Expand Up @@ -346,7 +350,6 @@ module.exports = function (grunt) {
'*.{ico,png,txt}',
'.htaccess',
'*.html',
'views/{,*/}*.html',
'images/{,*/}*.{webp}',
'fonts/*'
]
Expand Down Expand Up @@ -386,6 +389,20 @@ module.exports = function (grunt) {
]
},

// Convert Angular HTML view files to JavaScript cached versions
ngtemplates: {
dist: {
options: {
module: '<%= scriptAppName %>',
htmlmin: '<%%= htmlmin.dist.options %>',
usemin: '<%%= yeoman.dist %>/scripts/scripts.js'
},
cwd: '<%%= yeoman.app %>',
src: 'views/{,*/}*.html',
dest: '.tmp/scripts/templateCache.js'
}
},

// By default, your `index.html`'s <!-- Usemin block --> will take care of
// minification. These next options are pre-configured if you do not wish
// to use the Usemin blocks.
Expand Down Expand Up @@ -455,6 +472,7 @@ module.exports = function (grunt) {
'bowerInstall',
'useminPrepare',
'concurrent:dist',
'ngtemplates',
'autoprefixer',
'concat',
'ngmin',
Expand Down
1 change: 1 addition & 0 deletions templates/common/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-angular-templates": "~0.5.3",
"grunt-autoprefixer": "~0.4.0",
"grunt-bower-install": "~1.0.0",
"grunt-concurrent": "~0.5.0",
Expand Down