【问题标题】:Grunt SASS contrib does not generate css files in target directoryGrunt SASS contrib 不在目标目录中生成 css 文件
【发布时间】:2015-10-25 19:30:25
【问题描述】:

我是 SASS 新手,我正在尝试使用 grunt-contrib-sass 在本地编译 Prestashop 模板的 .scss 文件。配置如下:

sass: {
    dist: {
        options: {
            compass: true
        },
        files: [{
            expand: true,
            cwd: '_theme/themes/swat-theme/sass',
            src: ['*.scss'],
            dest: '../css',
            ext: '.css'
        }]
    }
},

当我在命令行上运行grunt sass 时,它会显示:

完成,没有错误

然而,当我检查目标目录时,没有创建新的.css 文件(我也尝试在运行grunt sass 之前删除一些文件)。

我该如何解决这个问题?

【问题讨论】:

  • 运行grunt sass --verbose 说什么?
  • 那个 grunt-contrib-sass 有一个 bug loool。计算 dest 时不考虑 cwd。我的文件已创建,但比我的项目目录的根目录高一级...

标签: node.js sass gruntjs prestashop-1.6


【解决方案1】:

解决办法是修改dest:

sass: {
    dist: {
        options: {
            compass: true
        },
        files: [{
            expand: true,
            cwd: '_theme/themes/swat-theme/sass',
            src: ['*.scss'],
            dest: '_theme/themes/swat-theme/css',
            ext: '.css'
        }]
    }
},

【讨论】:

    猜你喜欢
    • 2013-08-08
    • 2015-01-02
    • 1970-01-01
    • 1970-01-01
    • 2015-02-16
    • 2013-03-17
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    相关资源
    最近更新 更多