它将单个 scss 文件编译为 css。但如果有,例如:“@import “variables/_colors.scss”;” 它不工作。这只是一个猜测,这就是原因。
什么不见了?
这是我的 gruntfile.js:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
uses_defaults: {}
},
sass: {
dist: {
options: {
style: 'expanded'
},
files: [{
expand: true,
cwd: 'sites/all/themes/tarsoly/sass/',
src: ['**/*.scss'],
dest: 'sites/all/themes/tarsoly/css/',
ext: '.css'
}]
}
},
watch: {
css: {
files: 'sites/all/themes/tarsoly/**/*.scss',
tasks: [ 'sass' ],
options: { livereload: true }
}
},
});
// Default task(s).
grunt.registerTask('default', ['watch']);
// Load Grunt plugins
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass-globbing');
};