为什么Yeoman没有/样式/字体?

时间:2013-08-17 15:49:06

标签: gruntjs yeoman

运行grunt build后,我在fonts内没有dist/styles目录。 我做错了什么?

以下是Gruntfile.js中的内容:

    compass: {
        options: {
            sassDir: '<%= yeoman.app %>/styles',
            cssDir: '.tmp/styles',
            imagesDir: '<%= yeoman.app %>/../images',
            javascriptsDir: '<%= yeoman.app %>/scripts',
            fontsDir: '<%= yeoman.app %>/../styles/fonts',
            importPath: 'app/bower_components',
            relativeAssets: true,
        },
        dist: {
            options: {
                imagesDir: '<%= yeoman.dist %>/images',
                fontsDir: '<%= yeoman.app %>/../styles/fonts'
            }
        },
        server: {
            options: {
                debugInfo: true
            }
        }
    },

1 个答案:

答案 0 :(得分:15)

compass任务不负责将字体从app复制到dist。这由copy任务处理,通常如下所示:

copy: {
  dist: {
    files: [{
      expand: true,
      dot: true,
      cwd: '<%= yeoman.app %>',
      dest: '<%= yeoman.dist %>',
      src: [
        '*.{ico,png,txt}',
        '.htaccess',
        'bower_components/**/*',
        'images/{,*/}*.{gif,webp}',
        'styles/fonts/*' // <-- Where fonts are copied.
      ]
    }, {
      expand: true,
      cwd: '.tmp/images',
      dest: '<%= yeoman.dist %>/images',
      src: [
        'generated/*'
      ]
    }]
  }
}
相关问题