From 6b882cb1df3c6870a85d6046c97cdf7649eff9f2 Mon Sep 17 00:00:00 2001 From: Florens Verschelde Date: Fri, 15 Jul 2016 16:23:36 +0200 Subject: [PATCH] refactor: naming clarifications --- README.md | 3 +-- gulp/builders/jsconcat.js | 11 ++++++----- gulp/builders/svgsprite.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 52826f8..d50f226 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ Changing the location of the gulp scripts ----------------------------------------- - If you rename the `assets/config.js` file or move it somewhere else, update the `assets` property in the `"config"` section of `package.json`. - - If you rename the `gulp` directory or move it somewhere else, update the `--gulpfile` parameters in the `"scripts"` section of `package.json`. @@ -74,7 +73,7 @@ Task script: `gulp/builders/sass.js` // Defaults to 'compressed', can also be: 'nested', 'expanded', 'compact' outputStyle: 'compressed', // (Optional) Sass include paths (for @import) - includePaths: [] + includePaths: ['node_modules'] } ``` diff --git a/gulp/builders/jsconcat.js b/gulp/builders/jsconcat.js index f98332b..290c04c 100644 --- a/gulp/builders/jsconcat.js +++ b/gulp/builders/jsconcat.js @@ -22,14 +22,15 @@ var showSize = require('../helpers/size.js') * @property {string} config.dest - output file name * @returns {*} */ -module.exports = function concatJS(config) { - var dest = path.parse(config.dest) +module.exports = function buildJsConcat(config) { + var destInfo = path.parse(config.dest) + return gulp.src(config.src) .pipe( plumber(notify) ) .pipe( sourcemaps.init() ) - .pipe( concat(dest.base) ) + .pipe( concat(destInfo.base) ) .pipe( uglify() ) - .pipe( showSize(dest.dir) ) + .pipe( showSize(destInfo.dir) ) .pipe( sourcemaps.write('.') ) - .pipe( gulp.dest(dest.dir) ) + .pipe( gulp.dest(destInfo.dir) ) } diff --git a/gulp/builders/svgsprite.js b/gulp/builders/svgsprite.js index f762339..b1903b2 100644 --- a/gulp/builders/svgsprite.js +++ b/gulp/builders/svgsprite.js @@ -22,11 +22,11 @@ var showSize = require('../helpers/size.js') * @property {boolean} config.inline - for inlining in HTML documents * @returns {*} */ -module.exports = function makeSvgSprite(config) { +module.exports = function buildSvgSprite(config) { // Prepare options - var dest = path.parse(config.dest) + var destInfo = path.parse(config.dest) var opts = { - mode: { symbol: { dest: '.', sprite: dest.base } }, + mode: { symbol: { dest: '.', sprite: destInfo.base } }, shape: { id: {separator: '-'}, transform: ['svgo'] } } if (config.inline) { @@ -39,6 +39,6 @@ module.exports = function makeSvgSprite(config) { return gulp.src( config.src ) .pipe( plumber(notify) ) .pipe( svgSprite(opts) ) - .pipe( showSize(dest.dir) ) - .pipe( gulp.dest(dest.dir) ) + .pipe( showSize(destInfo.dir) ) + .pipe( gulp.dest(destInfo.dir) ) }