sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.51k stars 1.32k forks source link

Running sass on task-runner doesn't do anything and produces no errors. #2068

Closed DrynnBavis closed 7 years ago

DrynnBavis commented 7 years ago

For a full background I'm trying to run gulp-sass as a watch task on all .scss files for an ASP.NET MVC5 project in Visual Studio 2015. I have followed your documentation and been through some posts but can't find anything specific to my case. This is content in my gulpfile.js file:

'use strict';

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

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

gulp.task('sass:watch', function () {
    gulp.watch('./Content/**/*.scss', ['sass']);
});

And this is the result it spits out:


> cmd.exe /c gulp -b "c:\users\davibry\documents\visual studio 2015\Projects\WebApplication2\WebApplication2" --color --gulpfile "c:\users\davibry\documents\visual studio 2015\Projects\WebApplication2\WebApplication2\Gulpfile.js" sass
[14:49:36] Using gulpfile c:\users\davibry\documents\visual studio 2015\Projects\WebApplication2\WebApplication2\Gulpfile.js
[14:49:36] Starting 'sass'...
Process terminated with code 0.
[14:49:36] Finished 'sass' after 24 ms

All my scss files are in the Content folder within the root directory of the project. After running this I go to check the contents of my Content folder and all my scss files remain uncompiled. Anything I'm forgetting to do?

DrynnBavis commented 7 years ago

UPDATE: removing the return in return gulp.src('./Content/**/*.scss') fixed my problem. Not sure why this was an issue but hope that helps anyone