Tuesday, 15 September 2015

css - Indented Sass syntax not working with node-sass and gulp-sass -



css - Indented Sass syntax not working with node-sass and gulp-sass -

libsass 2.0 brought indented syntax libsass users, far i've been unable create work node-sass , gulp-sass. have of latest versions:

node-sass: 0.93 gulp-sass: 0.7.2 gulp: 3.8.2

this setup compiles .scss files , .sass files using bracket syntax not compile indented syntax. has compiled indented syntax node-sass , gulp?

my gulpfile.js

var gulp = require('gulp'); var sass = require('gulp-sass'); gulp.task('sass', function() { homecoming gulp.src('./sites/all/themes/nsfvb/sass/screen.sass') .pipe(sass({ includepaths: require('node-neat').includepaths, errlogtoconsole: true } )) .pipe(gulp.dest('./sites/all/themes/nsfvb/css')); }); gulp.task('watch', function() { gulp.watch('./sites/all/themes/nsfvb/sass/*.sass', ['sass']); }); gulp.task('default', ['sass', 'watch']);

error when running default task

error: invalid top-level expression

updated answer:

if want utilize indented syntax (.sass) top level file, utilize sass({indentedsyntax: true}).

sass({indentedsyntax: true}) outdated answer

answer found here: https://github.com/dlmanning/gulp-sass/issues/55#issuecomment-50882250

with default settings compiling sass files doesn't work. there workaround. if pass sourcecomments: 'normal' parameter compilation work. reason there unusual status alter how file handled: https://github.com/dlmanning/gulp-sass/blob/master/index.js#l23-l27

code illustration found here: https://github.com/chrisdl/gulp-libsass-example/blob/master/gulpfile.js

var gulp = require('gulp'); var sass = require('gulp-sass'); // run "> gulp sass" in terminal. gulp.task('sass', function () { gulp.src('./sass/main.sass') .pipe(sass({sourcecomments: 'normal'})) .pipe(gulp.dest('./css')); }); notice

if run issues using snippet take @ next quote , issue.

using workaround result in changes file content before in gulp pipeline (e.g. before plugins) beingness discarded - jmm

https://github.com/dlmanning/gulp-sass/issues/158

css node.js sass gulp

No comments:

Post a Comment