N
N
Nikita Ivanov2016-04-03 18:36:29
Node.js
Nikita Ivanov, 2016-04-03 18:36:29

Does Gulp compile Sass files that start with an underscore?

There was a problem. After I changed gulp-ruby-sass to gulp-sass, when compiling sass files, scss files starting with an underscore are added to my dist folder.
Brief gulpfile.js

var gulp = require('gulp'),
    sass = require('gulp-sass');

var src = {
    root    : 'src',
    sass    : 'src/sass/**/*.scss',
}

gulp.task('sass', function() {
    gulp.src(src.sass)
        .pipe(sourcemaps.init())
        .pipe(plumber())
        .pipe(autoprefixer("last 2 version", "ie>=9"))
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('dist/css'))
        .pipe(reload({stream:true}));
});

gulp.task('watch', ['sass'], function() {
    gulp.watch(src.sass, ['sass']);
});
gulp.task('default', ['watch']);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Strukov, 2016-04-03
@pm_wanderer

Put all underscored files inside one main file via import and point this main file to gulp.src(src/sass/ myStyle.scss )

D
Dmitry Kravchenko, 2016-04-03
@mydearfriend

var src = {
    root    : 'src',
    sass    : ['src/sass/**/*.scss', '!src/sass/**/_*']
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question