1

它将单个 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');
};
4

0 回答 0