hello world
hello world

Reputation: 425

Gulp ignore when compiling to css

I have a SASS file which uses @import in order to reference variables from another SASS file. I want to know if there is a way of ignoring the specific @import of a SASS during compile time?

e.g. Home.SCSS file includes

@import "modules/modules.scss";

I want to compile the Home.SCSS file to css but I want to ignore the above import. If i remove the above line from the file then I receive error as my Home.SCSS references variables from the import.

Upvotes: 0

Views: 587

Answers (1)

Wes Foster
Wes Foster

Reputation: 8900

You can tell gulp to ignore certain files or directories using !

gulp.task('styles', function() {
  gulp.src([
      'scss/*.scss',
      '!scss/modules/modules.scss'
    ])
});

Upvotes: 1

Related Questions