I'm having trouble with a glob and gulp.dest(). My task looks like this
return gulp.src('./clients/*/assets/less/*.less',{ base: process.cwd() })
.pipe(less({
paths:[path.join(__dirname, 'less')]
}).on('error', function(err){
gutil.log(err);
this.emit('end');
}))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(gulp.dest(function(file){
return path.normalize(path.join(file.path, '../css'));
}));
If my path for example was ./clients/my-client/assets/less/style.less
the path ends up being `./clients/my-client/assets/css/my-client/assets/less/css
I tried using a rename function like
.pipe(rename(function (path) {
path.dirname = '';
}))
Before but all that did was put the file at ./clients/css/style.css
The desired directory should be ./clients/my-client/assets/less/style.css
and thought this would all be rather easy, and perhaps it is, but I'm really struggling. Any help would be really appreciated!