From ea97af2dc98e4f55d0e59aab86026b71393dbe51 Mon Sep 17 00:00:00 2001 From: Shahar Talmi Date: Fri, 4 Apr 2014 12:24:59 +0300 Subject: [PATCH] fix(usemin): do not clear generated file if section not found --- Gruntfile.js | 8 ++++++++ tasks/lib/appender.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 78fc29b..f56c287 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -97,6 +97,14 @@ module.exports = function(grunt) { } }, + custom_usemin_not_found: { + src: ['test/fixtures/one.html', 'test/fixtures/two/**/*.html'], + dest: 'tmp/custom_concat_usemin_not_found.js', + options: { + usemin: 'usemin/not_found.js' + } + }, + html5: { src: ['test/fixtures/html5.html'], dest: 'tmp/html5.js' diff --git a/tasks/lib/appender.js b/tasks/lib/appender.js index 7ab9d47..e105051 100644 --- a/tasks/lib/appender.js +++ b/tasks/lib/appender.js @@ -117,7 +117,7 @@ var Appender = function(grunt) { */ this.save = function(target, files) { grunt.config(['concat', target], { - files: files, + files: files || grunt.config(['concat', target, 'files']), options: grunt.config(['concat', target, 'options']) || {} });