J
J
JastaFly2020-01-27 09:44:06
gulp.js
JastaFly, 2020-01-27 09:44:06

Exceptions in Gulp src?

Good day to all! Created a separate file with SCSS variables. It is located in the same folder as the other SCSS files. I want it to not compile to CSS, I tried this:

gulp.task('sass', function(done) {
    gulp.src("scss/*.scss",
            "!scss/variables.scss")
        .pipe(sass())
        .pipe(gulp.dest("css/"))
    done();
});
Не работает. Подскажите плиз как это сделать???

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim Morev, 2020-01-27
@SeaInside

The src() method takes a string or an array as its first parameter. That is, it should be:
gulp.src(["scss/*.scss", "!scss/variables.scss"])
In general, it is better to tie it with the connection of styles in this way - there will be more flexibility.
You take one style.scss file, send it for compilation in the task, and already in this file, using the directive @import, you control what you need and do not need to include, and you do not need to climb into the assembly to make changes.

D
Dymok, 2020-01-27
@UnluckySerivelha

If galp is version 4, then the solution is here https://stackoverflow.com/a/40098885/12213063

J
JastaFly, 2020-01-27
@JastaFly

Don't thank you. Restarted gulp and earned Maxim Morev's code. Thanks to all)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question