Answer the question
In order to leave comments, you need to log in
Find filename in gulp stream?
There is such a task
/* Paths */
var src = {
modules: 'src/modules',
css: {
skin: 'src/assets/styles/skins/',
assets: 'src/assets/styles/'
}
},
dist = {
css: '../novi/projects/template/css/'
};
/* End Paths */
var assets = skins.map(function (skin) {
return gulp.src(src.css.assets + '[^_]*.scss')
.pipe(plugins.addSrc.prepend('src/assets/styles/skins/' + skin + '.scss'))
.pipe(plugins.concat(FileName + '.scss'))
.pipe(plugins.sass())
.pipe(gulp.dest(dist.css + skin + '/assets'));
});
Answer the question
In order to leave comments, you need to log in
1) npm i --save-dev gulp-tap
2)
3)const tap = require('gulp-tap');
gulp
.src(...)
.pipe(tap(file => {
const path = file.path;
const data = file.contents.toString();
}));
Of course, I could be wrong, but in my opinion the concat plugin requires the name of the final saved file in which the processed files will be merged, and not the name of the current file to be merged. Those. answer - you can enter any name convenient for you there, have you tried it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question