加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 当项目是用grunt构建时,Fontawesome不工作

发布时间:2020-12-17 09:07:39 所属栏目:安全 来源:网络整理
导读:我使用字体库字体真棒。它工作时,项目不是建立/ uglified与咕噜。 但是当我用grunt建立项目不工作。我在控制台中得到这个错误:… / fonts / fontawesome-webfont.woff?v = 4.0.3 404(找不到) 我用yeoman支撑了这个项目。 这是我的index.html !-- build:cs
我使用字体库字体真棒。它工作时,项目不是建立/ uglified与咕噜。

但是当我用grunt建立项目不工作。我在控制台中得到这个错误:… / fonts / fontawesome-webfont.woff?v = 4.0.3 404(找不到)

我用yeoman支撑了这个项目。

这是我的index.html

<!-- build:css styles/fontawesome.css -->
    <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
    <!-- endbuild -->

任何想法可能是错误?

更新
我需要将文件夹/ bower_components / font-awesome / fonts复制到dist / fonts。这需要在grunt文件中完成。可能在“复制”选项下

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/*'
      ]
    },{
      expand: true,cwd: '.tmp/images',dest: '<%= yeoman.dist %>/images',src: [
        'generated/*'
      ]
    }]
  },

但我不确定在哪里包括这个。

我有同样的问题。下面的代码解决了我的问题。
copy: {
    dist: {
        files: [{
            expand: true,cwd: '<%= config.app %>',dest: '<%= config.dist %>',src: [
                '*.{ico,*/}*.webp','{,*/}*.html','styles/fonts/{,*/}*.*'
            ]
        },{
            expand: true,cwd: 'bower_components/bootstrap/dist',// change this for font-awesome
            src: ['fonts/*.*'],dest: '<%= config.dist %>'
        }]
    }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读