I have been trying to setup a grunt task to compile my sass files but nothing seems to be working.
My working structure is
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 have already verified that I have sass installed
when I run grunt sass
, it says that everything when okay. But I have yet to see a compiled css file. The only way that I got this to work is by using the "destination" : "source"
syntax.
EDIT: The exact problem I'm having is not that the files are generating in the wrong place, but that they aren't generating. Also, grunt is not showing any errors
Does anyone have a clue as to what is wrong with this?
This configuration works for me:
files: [{
expand: true,
cwd: 'assets/sass',
src: ['**/*.scss'],
dest: 'assets/css',
ext: '.css'
}]
Perhaps the ../
is throwing it off; I don't believe the destination path is relative to the source path, it's relative to the Gruntfile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With