-
-
Save IvanTorresEdge/0da6fd36bb7331b6551d898fdf4b8034 to your computer and use it in GitHub Desktop.
Another way of splitting a gulpfile into multiple files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Another way of splitting a gulpfile into multiple files based on: | |
http://macr.ae/article/splitting-gulpfile-multiple-files.html | |
https://github.com/gulpjs/gulp/blob/master/docs/recipes/split-tasks-across-multiple-files.md | |
*/ | |
'use strict'; | |
var gulp = require('gulp'), | |
plugins = require('gulp-load-plugins')(), | |
taskPath = './tasks/', | |
// async readdir does not identify task names | |
taskList = require('fs').readdirSync(taskPath); | |
taskList.forEach(function (taskFile) { | |
// or .call(gulp,...) to run this.task('foobar')... | |
require(taskPath + taskFile)(gulp, plugins); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (gulp, $) { | |
'use strict'; | |
gulp.task('styles', function () { | |
return gulp.src(['app/public/scss'], { dot: false }) | |
.pipe($.sass()) | |
.pipe(gulp.dest('dist/css')) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment