输出 css 文件的特定文件名 grunt-contrib-compass

Output specific file name of css file grunt-contrib-compass

我正在尝试从我的 grunt-contrib-compass 作业中指定 CSS 文件的输出名称。默认输出和 index.css 文件。

实际结果 <%= yeoman.app %>/specialdir/themes/index.css

想要的结果 <%= yeoman.app %>/specialdir/themes/my-theme.css

Gruntfile.js

....
compass : {
  // specialjob here
  specialjob : {
    options : {
      sassDir : '<%= yeoman.app %>/specialdir/my-theme',
      cssDir : '<%= yeoman.app %>/specialdir/themes', // should output into this folder
      relativeAssets : false,
      assetCacheBuster : false,
      raw : 'Sass::Script::Number.precision = 10\n'
    },
    dist : {
      options : {
        generatedImagesDir : '<%= yeoman.app %>/specialdir/images/generated'
      }
    },
    server : {
      options : {
        sourcemap : true
      }
    }
  },

有什么想法吗?

您需要将源文件重命名为 my-theme.scss 才能获得 my-theme.css。浏览 the source 似乎这是默认行为。

编码愉快!