Gulp-sass work to support load_path?

Problem: I am using gulp -sass and would like to define load_path, so I don't need to have really long @import rules for dependencies between towers, for example.

@import "normalize" 

instead

 @import "../../../../../bower_components/bootstrap-sass/assets/stylesheets/bootstrap/normalize" 

What is the best way to achieve this when using gulp-sass, which uses the LibSass mechanism to process sass files?

+7
css import sass gulp-sass
source share
1 answer

After that, I found an option in gulp-sass:

sass ({ includePaths: ['./bower_components/bootstrap-sass/assets/stylesheets']})

Example:

 var gulp = require('gulp'), sass = require('gulp-sass') notify = require("gulp-notify"); var config = { sassPath: './resources/sass', // store the sass files I create bowerDir: './bower_components' } gulp.task('css', function() { return gulp.src(config.sassPath + '/style.scss') .pipe(sass({ outputStyle: 'compressed', includePaths: [ './resources/sass', config.bowerDir + '/bootstrap-sass/assets/stylesheets', config.bowerDir + '/font-awesome/scss'] }) .on("error", notify.onError(function (error) { return "Error: " + error.message; }))) .pipe(gulp.dest('./public/css')); }); 
+20
source share

All Articles