From 916589cee19566ca23b93f1f5713f0817d4ce40c Mon Sep 17 00:00:00 2001 From: Vesa H Date: Mon, 21 Apr 2014 16:34:27 +0300 Subject: [PATCH 1/3] Updated package.json Changed usemin to a newer version. Added concat because usemin requires it. This was done at the same time as using usemin when grunting was fixed. --- app/templates/_package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/templates/_package.json b/app/templates/_package.json index bc4b718..6b4297c 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -9,6 +9,7 @@ "devDependencies": { "grunt": "~0.4.1", "grunt-contrib-clean": "~0.5.0", + "grunt-contrib-concat": "~0.3.0", "grunt-contrib-uglify": "~0.2.4", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-connect": "~0.5.0", @@ -19,7 +20,7 @@ "grunt-contrib-htmlmin": "~0.1.3", "grunt-contrib-imagemin": "~0.2.0", "grunt-rev": "~0.1.0", - "grunt-usemin": "~0.1.12", + "grunt-usemin": "~2.1.1", "grunt-open": "~0.2.0", "grunt-svgmin": "~0.2.0", "grunt-concurrent": "~0.3.0", From 845a2f8367b88e68c07ca284899bfbca4ed618fe Mon Sep 17 00:00:00 2001 From: Vesa H Date: Mon, 21 Apr 2014 16:36:36 +0300 Subject: [PATCH 2/3] Fixed usemin and rev tasks in the Gruntfile Now usemin concats and uglifies the scripts correctly when running `grunt build`. Removed revving of images and fonts because it seems like they don't work correctly with Crafty at the moment. --- app/templates/_Gruntfile.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/templates/_Gruntfile.js b/app/templates/_Gruntfile.js index d957a83..ecee4c6 100644 --- a/app/templates/_Gruntfile.js +++ b/app/templates/_Gruntfile.js @@ -145,15 +145,13 @@ module.exports = function (grunt) { files: { src: [ '<%%= yeoman.dist %>/scripts/{,*/}*.js', - '<%%= yeoman.dist %>/styles/{,*/}*.css', - '<%%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}', - '<%%= yeoman.dist %>/styles/fonts/*' + '<%%= yeoman.dist %>/styles/{,*/}*.css' ] } } }, useminPrepare: { - html: '.tmp/index.html', + html: '<%%= yeoman.app %>/index.html', options: { dest: '<%%= yeoman.dist %>' } @@ -220,9 +218,7 @@ module.exports = function (grunt) { '*.{ico,txt}', '.htaccess', 'images/{,*/}*.{webp,gif}', - 'styles/fonts/*', - 'libs/**', - 'bower_components/**' + 'styles/fonts/*' ] }] } @@ -256,7 +252,7 @@ module.exports = function (grunt) { } }, src: '<%%= yeoman.app %>/scripts/app.js', - dest: '<%%= yeoman.dist %>/scripts/combined-scripts.js' + dest: '.tmp/scripts/combined-scripts.js' }, } }); @@ -294,6 +290,7 @@ module.exports = function (grunt) { 'useminPrepare', 'concurrent:dist', 'neuter:dist', + 'concat', 'cssmin', 'uglify', 'copy', From 506da0b99ce5ab1d1465725a99f796f4c45ef7d0 Mon Sep 17 00:00:00 2001 From: Vesa H Date: Mon, 21 Apr 2014 16:42:37 +0300 Subject: [PATCH 3/3] Removed 'uglify' configuration from Gruntfile Usemin generates the uglify configuration automatically so this was useless. --- app/templates/_Gruntfile.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/templates/_Gruntfile.js b/app/templates/_Gruntfile.js index ecee4c6..fbf43bc 100644 --- a/app/templates/_Gruntfile.js +++ b/app/templates/_Gruntfile.js @@ -130,16 +130,6 @@ module.exports = function (grunt) { } } },<% } %> - uglify: { - options: { - mangle: false - }, - dist: { - files: { - '<%%= yeoman.dist %>/scripts/combined-scripts.min.js': ['<%%= yeoman.dist %>/scripts/combined-scripts.js'] - } - } - }, rev: { dist: { files: {