Answer the question
In order to leave comments, you need to log in
How to add a folder with the specified name before the saved file?
There is an approximate file structure in the project:
_SRC
__JS
__IMG
__SASS
___LAYOUT1
____default.scss
____home.scss
___LAYOUT2
____default.scss
____home.scss
...
_PRODUCTION
__ASSETS
___LAYOUT1
____JS
____IMG
____css
_____default.css
_____home.css
___LAYOUT2
____JS
____IMG
____css
_____default.css
_____home.css
...
gulp.task('Sass', function () {
gulp.src('./SRC/SASS/**/*.scss')
.pipe(dest(':folder/:name.css', {folder: 'css'}))
.pipe(gulp.dest('./PRODUCTION/ASSETS/'));
});
Answer the question
In order to leave comments, you need to log in
In general, I figured it out myself, if anyone needs it, then here is the solution:
// Подключаем rename
var rename = require("gulp-rename");
.pipe(rename(function (path) {
// В условии можно исключать папки, если необходимо
if(path.dirname.split("\\").pop()!=="themes"){
// Добавляем путь
path.dirname += "/css";
}
})
he may not like the fact that the array of files to be processed is implicitly specified (./SRC/SASS/**/*.scss), try replacing with
and check if it starts working
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question