Hot answers tagged

3

Duplication Some strings appear suspiciously often: build/images build/css assets/images assets/js assets/scss It might be a good idea to extract these to constants. Maybe you will never change their values, but variables would have the advantage of easy autocompletion in a descent IDE. Also, this array appears twice, and might be useful to put it in a ...


3

My only opinion on your mostly well written Gulpfile is to consider restructuring your 330+ line Gulpfile into multiple files, separated by grouped tasks. During an overview of your file, the tasks seemed to be loosely categorized into three groups: image modifications copying / Jekyll JavaScript and Sass As someone who doesn't like large files of code, I ...


2

Interesting question; some review remarks before addressing your actual question: You never seem to pass filePath to src but use path["sass"] instead I always suggest to pipe your console.log calls through a log function that accepts a severity parameter so that you can customize the level of logging, but that's probably overkill for Gulp I would add a ...


2

If I understood what you are doing correctly you are compiling index.handlebars using data from content.js and you want to recompile if any of those files changes. Below is a simplified and NOT TESTED example of what your code can look like // removed gulp-watch (built in gulp by default) // also removed spawn, argv and batch var gulp = require('gulp'); var ...


1

The first thing that I see is that: major = parseInt(versionArray[0]) + 1; Is a bit redundant. You already say: major = parseInt(versionArray[0]); Just do: major += 1; (This is similar for all the major, minor and patch statements) You can also use a switch-case instead of if statements so instead of: if (ver === 'major') { major = parseInt(...


1

I'm not sure if this is the best place for this question, your gulp tasks look fine to me, it's more of a development issue I think. Regardless, I use a similar setup to you except that I use require.js to load the modules whilst in development. This has the benefit of greater code re-use as you can separate your JavaScript into manageable small partials, ...


Only top voted, non community-wiki answers of a minimum length are eligible