【问题标题】:Running grunt and compiling sass to the same directory as source files运行 grunt 并将 sass 编译到与源文件相同的目录
【发布时间】:2015-06-12 03:54:11
【问题描述】:

我的所有 scss 都在父文件夹下,我正在运行一个繁重的任务来编译它们。

对于这个特定的项目,不会有构建或输出文件夹。我想让所有的 scss 文件在它们的同一个目录中编译。

+ folder + component - style.scss - style.css + another - style.scss - style.css

我搜索了高低,找不到任何这样的例子。 Grunt 甚至可以吗?

【问题讨论】:

    标签: gruntjs grunt-contrib-sass


    【解决方案1】:

    想通了,想发布这个,以防其他人需要实现这一点。

    cwd 和 dest 必须是相同的值。

    dist: {
                files: [{
                    expand: true, // Recursive
                    cwd: "<%= pathTo.Root %>", // The startup directory
                    src: '**/*.{sass,scss}', // Source files
                    dest: "<%= pathToRoot %>",
                    ext: ".css" // File extension 
                }]
            }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-04
      • 1970-01-01
      • 2015-01-02
      相关资源
      最近更新 更多