Fontawesome is not working when project is built with grunt

前端 未结 15 1164
余生分开走
余生分开走 2020-12-02 07:50

I\'m using the font library font awesome. It works when the project is not built/uglified with grunt.

But when I\'m building the project with grunt it\'s not workin

15条回答
  •  猫巷女王i
    2020-12-02 08:13

    I had the same problem. The following code solved my problem.

    copy: {
        dist: {
            files: [{
                expand: true,
                dot: true,
                cwd: '<%= config.app %>',
                dest: '<%= config.dist %>',
                src: [
                    '*.{ico,png,txt}',
                    '.htaccess',
                    'images/{,*/}*.webp',
                    '{,*/}*.html',
                    'styles/fonts/{,*/}*.*'
                ]
            },{
                expand: true,
                dot: true,
                cwd: 'bower_components/bootstrap/dist', // change this for font-awesome
                src: ['fonts/*.*'],
                dest: '<%= config.dist %>'
            }]
        }
    }
    

提交回复
热议问题