grunt-contrib-sass 问题

Issue With grunt-contrib-sass

我遇到了 Grunt 的 grunt-contrib-sass 包的问题,​​我只是忽略了。当它编译我的 sass 时,我希望它进入我的 css 目录,而不是在 css 目录中创建一个 sass 目录。这是 grunt-contrib-sass 编译后我现在拥有的。我不希望它在编译时在 css 目录中添加 sass 目录:

- css
    - sass (I don't want this level)
        - default
            - index.css
- sass
    - default
        - index.scss
        - fonts.scss
- Gruntfile.js
- grunt
    - watch.js
    - sass.js

Gruntfile.js

module.exports = function(grunt) {
    var options = {
        config: {
            src: './grunt/*.js'
        },
        pkg: grunt.file.readJSON('package.json')
    };

    var config = require('load-grunt-config')(grunt, options);

    grunt.initConfig(config);

    grunt.registerTask('default', ['watch']);
};

sass.js

module.exports = {
    skins: {
        options: {
            style: 'compressed'
        },
        files: [{
            expand: true,
            src: ["sass/**/index.scss"],
            dest: "css/",
            ext: '.css'
        }]
    }
};

watch.js

module.exports = {
    sass: {
        files: [
            'sass/**/*.scss',
        ],
        tasks: ['sass'],
        options: {
            livereload: true
        }
    }
};

试试这个 sass.js

module.exports = {
    skins: {
        options: {
            style: 'compressed'
        },
        files: [{
            expand: true,
            cwd: 'sass/default',
            src: 'index.scss',
            dest: 'css/',
            ext: '.css'
        }]
    }
};