css - Gruntfile.js SASS 任务配置

标签 css ruby node.js sass gruntjs

Line 'css/????????': 'sass/????????' 下面是我整理不出来的。由于有多个目录和 SASS 文件级别,我安装了 sass-globbing。我的/sass目录下有4个独立编译的sass文件。

module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            sass: {
                files: ['sass/{,**/}*.{scss,sass}'],
                tasks: ['sass:dist']
            },
        },
        sass: {
            options: {
                sourceMap: false,
                outputStyle: 'expanded'
            },
            dist: {
                files: {
                    'css/???????': 'sass/???????'
                }
            }
        }
    });
    grunt.registerTask('default', ['sass:dist', 'watch']);
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
};

最佳答案

这应该有效;

dist: {
     files: {
                    'css/style.css': 'sass/**/*.scss'
                }
            }

关于css - Gruntfile.js SASS 任务配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27476833/

相关文章:

ruby - 尽管安装但未找到 rbenv 命令

html - 从 Ruby 中的 HTML 字符串生成 HTML 页面的原始字符串元描述?

javascript - Mongo 填充可选字段,给出强制转换错误

html - div的位置不对

html - 在 CSS 中,当声明 'white-space: nowrap' 时,iOS 将字体调整为更小

ruby - 在设备登录时取消删除 acts_as_paranoid 已删除的用户

node.js - npm install -g yo 隧道套接字错误

javascript - async/await 不会将构建的数组返回到父 array.map()

html - Opera12 和 IE9 中的 rem 单位不准确

html - 如何获得分区之间的间距