Sass grunts not working

I am trying to configure the grunt task to compile my sass files, but nothing works.

My work structure

Gruntfile.js package.json assets | |--sass | | | styles.scss | |--css 

and this is my grunt file

 'use strict'; module.exports = function (grunt) { grunt.initConfig({ sass: { dist: { options: { style: 'expanded' }, files: [{ expand: true, cwd: 'assets/sass', src: ['*.scss'], dest: '../css', ext: '.css' }] } } }); grunt.loadNpmTasks('grunt-sass'); grunt.registerTask('default', ['sass']); }; 

I already checked that I have sass installed

when I run grunt sass , it says that everything is OK. But I have not seen the compiled css file yet. The only way I got this is to use the syntax "destination" : "source" .

EDIT: The exact problem I ran into is not that the files are being generated in the wrong place, but that they are not being generated. In addition, grunt does not show any errors

Does anyone know what's wrong with that?

+6
source share
1 answer

This configuration works for me:

 files: [{ expand: true, cwd: 'assets/sass', src: ['**/*.scss'], dest: 'assets/css', ext: '.css' }] 

Perhaps ../ throws it away; I do not think that the destination path refers to the source path, it is relative to the Grunt file.

+18
source

Source: https://habr.com/ru/post/955643/


All Articles