In Visual Studio 2017 my Gruntjs sass Task Runner job exits with Code 0

354 Views Asked by At

My grunt sass task quits VS2017 task runner with throwing code "0" AND without generating any CSS file. I don't know where I go wrong. Thank you for your help.


Prerequisites:

  1. Task runner comes installed with Visual Stock 2017, no more extension needed.
  2. I installed the NPM Task Runner extension for accessing the nodejs repository

  3. Then I installed nodeJS for windows and Gruntjs as explained by Colin Bacon here

  4. I installed successfully Bootstrap v4 alpha via NuGet Visual Studio 2017 Packet Manager PM Install-Package bootstrap.sass -Version 4.0.0-alpha6 -Pre
  5. Configured the gruntfile.js as in step 3, saved it in project root and edited the sass section as below.

Goal: I want to create a Grunt job, that creates a css file from the bootstrap sass source.


Problem: Grunt quits the sass-job with Code "0". No css file is generated in the "stylesheets" directory off project root.

Here is the relevant code snippet from the gruntfile.js:


// SASS
sass: {
    options: {
        sourceMap: true, // Create source map
        outputStyle: 'compressed' // Minify output
    },
    dist: {
        files: [
            {
                expand: true, // Recursive
                cwd: "Content/bootstrap", // Bootstraps' scss files' source directory
                src: ["**/*.scss"], // Source files
                dest: "stylesheets", // Destination
                ext: ".css" // File extension
            }
        ]
    }
},

Any ideas where I go wrong or where I should look for next? Do I need to do something to the bootstrap scss files?

Thank you, your help is much appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

It turns out that all the steps were correct.

The problem was that the folder view in VS2017 did not get updated automatically. I restarted VS2017 and all the files showed up in the stylesheet folder.

So, when you have a destination folder that is empty, then after running the grunt task make sure to right click on the destination folder and hit "refresh folder" or "update folder" or something like that (I use VS in my native language and there it says "Ordner aktualisieren").