8

运行后,grunt buildfonts里面没有目录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
            }
        }
    },
4

1 回答 1

14

compass任务不负责将字体从 复制appdist。这由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/*'
      ]
    }]
  }
}
于 2013-08-18T00:12:04.087 回答