Snippet from gruntfile.js
sass: {
compile: {
files: [{
expand: true,
cwd: 'css/',
src: ['^[^_].scss'],
dest: '../css/',
ext: '.css'
}]
}
},
This should work according to rubular.
Basically I want to compile all .scss files in the 'css' directory, unless they start with an underscore. However, that pattern doesn't match anything?
Any ideas?
Try this pattern: ['*.scss', '!_*.scss']
. It'll make the distinction more explicit, too.
sass: {
compile: {
files: [{
expand: true,
cwd: 'css/',
src: ['*.scss', '!_*.scss'],
dest: '../css/',
ext: '.css'
}]
}
},
If you want to match recursively (files in subfolders of cwd
), use **/*
sass: {
compile: {
files: [{
expand: true,
cwd: 'css/',
src: ['**/*.scss', '!**/_*.scss'],
dest: '../css/',
ext: '.css'
}]
}
},
Learn more about Grunt Globbing Patterns, which aren't the same as regular expressions.
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