问题
i would like to compile all SCSS files that are inside scss folder and are not imported ( file names do not start with _ ) each into separate CSS files( that has the same name as SCSS file ).
that kind of functionality that can be found in Prepros.
is it possible to do it with grunt-sass?
i tried this but it doesn't work:
sass: {
dist: {
files {
'css/*.css': 'scss/*.scss',
}
}
}
回答1:
You can try:
sass: {
dist: {
files: [{
expand: true,
cwd: 'styles',
src: ['*.scss'],
dest: '../public',
ext: '.css'
}]
}
}
回答2:
You need to build your file object dynamically, see here: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
来源:https://stackoverflow.com/questions/32690321/how-to-compile-multiple-scss-files-into-multiple-css-files-with-grunt-sass