M
M
Mike Diam2016-05-03 22:33:42
Sass
Mike Diam, 2016-05-03 22:33:42

Why doesn't grunt-sass work on windows?

Installed grunt-sass, but running the grunt sass command creates an empty css file, although the console prints a success message.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-05-04
@mikediam

dist is the name of the task in your case (you can rename it). Inside the task there should be files (and options, if necessary) fields. That is, it should be like this:

sass: {
            options: {
                sourceMap: false
            },
            prod: {
               files: { 'dest/style.css': 'css/style.scss'}
            },
            dev: {
               options: {sourceMaps: true}, // в разработке нужны соурсмапы               
               files: { 'dest/style.css': 'css/style.scss'}
            },
        },
// ...
// ...
    grunt.registerTask('default', ['concat:dev', 'uglify:dev', 'sass:dev', 'cssmin', 'htmlmin:dev', 'watch']); //'imagemin', 'uncss',
    grunt.registerTask('deploy',  ['concat:dev', 'uglify:prod', 'sass:prod', 'cssmin', 'htmlmin:prod']);

Note that the default task now uses sass:dev and deploy uses sass:prod. The corresponding change must be made in watch too, otherwise sass will be built twice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question