Creates file's paths in a simple and organized way
$ npm install --save-dev gulp-path
You can create simple paths, for input and output, as simple as this.
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var gp = require('gulp-path');
var app = new gp.Path('src', 'public');
var styles = app.generateAllPaths('styles', 'css', null, 'sass');
gulp.task('sass', function(){
// ./src/styles/*.sass
return gulp.src(styles.input)
.pipe(sass())
// ./public/css
.pipe(styles.output);
});
You can also create simple blob paths
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var gp = require('gulp-path');
var input = gp.generateBlob('src', 'components', '*', 'sass');
var output = gp.generateBlob('public', 'components', null, null);
gulp.task('sass', function(){
// ./src/styles/*.sass
return gulp.src(input)
.pipe(sass())
// ./public/css
.pipe(output);
});
All parameters of Path are waiting a string
or an array
. In that way, you
can have a simple path, multiple paths, or a composed path.
A property with the input path(s)
A property with the output path(s)
Creates a new Path
instance based on the previous path.
Generates all paths, an object that holds input and output only, based on the params and base path.
Generates all input paths based on the params and base path.
Generates all output paths based on the params and the base path.
Generates a blob of paths