gulp-recipe-loader
Automatic gulp recipe loading and task registration
example gulpfile
var gulp = require('gulp'),
requireDir = require('require-dir');
var config = requireDir('gulp-config');
var $ = require('gulp-recipe-loader')(gulp, config);
$.gulp.task('default', ['build']);
Sources configuration syntax
First of all, define your defualt base path. It has to be a real path. Default value is '.'
, but most probably wou will need to change it.
All paths are relative to gulpfile location.
sources.defaultBase = 'app/';
There are few ways to define source. The most basic one is just a string with glob path.
sources.css = 'app/styles/*.css';
You can also provide an array of globs or other sources.
sources.bowerScripts = [
'app/bower_components/*/*.js',
'app/bower_components/*/{dist,min,release}/*.js',
];
If you need to change the base for specific set of paths, you can use object notation.
sources.specialFiles = {
files: 'special/**/*',
base: 'special/'
};
Sources can be easily composited. You can use any valid source inside the other.
sources.devAssets = [
sources.js,
sources.css,
'app/icons/**/icon-*.svg',
sources.tempFiles
]
Important note: If you nest other sources inside source object, the properties of the outer object will be applied.
sources.myFiles = {
files: 'defs/scene-*.xml',
base: 'defs/'
};
sources.moreFiles = {
files: [sources.assets, 'more/*.files'],
base: 'more/'
}
The actual content of sources.moreFiles
will be identical to this:
sources.moreFiles = {
files: ['defs/scene-*.xml', 'more/*.files'],
base: 'hello/'
}
What you probably wanted to do instead is
sources.moreFiles = [
sources.myFiles,
{
files: 'more/*.files',
base: 'more/'
}
]