diff --git a/tasks/usemin.js b/tasks/usemin.js index 21ad81b..83b475e 100644 --- a/tasks/usemin.js +++ b/tasks/usemin.js @@ -16,12 +16,23 @@ var getFlowFromConfig = function (config, target) { post: {} }); if (config.options && config.options.flow) { + var steps; + var post; + if (config.options.flow[target]) { - flow.setSteps(config.options.flow[target].steps); - flow.setPost(config.options.flow[target].post); + steps = config.options.flow[target].steps; + post = config.options.flow[target].post; } else { - flow.setSteps(config.options.flow.steps); - flow.setPost(config.options.flow.post); + steps = config.options.flow.steps; + post = config.options.flow.post; + } + + if (steps) { + flow.setSteps(steps); + } + + if (post) { + flow.setPost(post); } } return flow; diff --git a/test/test-usemin-prepare.js b/test/test-usemin-prepare.js index 0dee425..90a2e9f 100644 --- a/test/test-usemin-prepare.js +++ b/test/test-usemin-prepare.js @@ -225,8 +225,7 @@ describe('useminPrepare', function () { flow: { steps: { js: ['uglify'] - }, - post: {} + } } } }); @@ -257,8 +256,7 @@ describe('useminPrepare', function () { html: { steps: { js: ['uglify'] - }, - post: {} + } } } } @@ -302,8 +300,7 @@ describe('useminPrepare', function () { flow: { steps: { js: [copy] - }, - post: {} + } } } });