From f09ddffb1c2f1b3e29006378be6699a594641959 Mon Sep 17 00:00:00 2001 From: Tomasz Szajna Date: Fri, 15 Apr 2016 10:46:34 +0200 Subject: [PATCH 1/2] Include paths src and dst support --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 23ddbc8..5055ddf 100644 --- a/index.js +++ b/index.js @@ -283,9 +283,16 @@ module.exports = function(S) { deferredCopies = []; includePaths.forEach(p => { - let destPath = path.join(_this.optimizedDistPath, p), - srcPath = path.join(_this.evt.options.pathDist, p), - destDir = (fs.lstatSync(p).isDirectory()) ? destPath : path.dirname(destPath); + let destPath, srcPath, destDir; + if( p.src && p.dest ){ + destPath = path.join(_this.optimizedDistPath, p.dest); + srcPath = path.join(_this.evt.options.pathDist, p.src); + destDir = destPath; + } else { + destPath = path.join(_this.optimizedDistPath, p); + srcPath = path.join(_this.evt.options.pathDist, p); + destDir = (fs.lstatSync( srcPath ).isDirectory()) ? destPath : path.dirname(destPath); + } fs.mkdirsSync(destDir, '0777'); deferredCopies.push( From b254aa90a8d52f6d65d25a72ef5c5af8d6d07ca4 Mon Sep 17 00:00:00 2001 From: Tomasz Szajna Date: Wed, 27 Apr 2016 13:42:18 +0200 Subject: [PATCH 2/2] Templates support --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 5055ddf..aa36287 100644 --- a/index.js +++ b/index.js @@ -63,7 +63,9 @@ module.exports = function(S) { // Get function let func = S.getProject().getFunction(evt.options.name), + populated = func.toObjectPopulated(evt.options), optimizer; + func.custom = populated.custom; // Skip if no optimization is set on function if (!func.custom || !func.custom.optimize) {