0

I am using gulp-sass module to compile scss files to css files.

This is my gulpfile.js

'use strict';

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

gulp.task('sass', function () {
  return gulp.src('sass/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('css'));
});

I have two files in my sass folder:

sass
|--- _test.scss
|--- demo.scss

The plugin compiles demo.scss file but not _test.scss, I tried with same content as well.

Is there something with the naming convention or I need to change my gulpfile.js.

1 Answer 1

1

You need to change _test.scss to test.scss.

Node sass ignores _filenames. Usually we use _ with files names which are going to be imported in the scss files.

Sign up to request clarification or add additional context in comments.

2 Comments

so we can only use this _*.scss for imports
Yes for @import "test.scss" or @import "test". You can import test inside the demo.scss

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.