Font Awesome and Glyhicons are not referenced to the right location #421

Closed
khwerhahn opened this Issue Aug 5, 2014 · 7 comments

Comments

Projects
None yet
4 participants
@khwerhahn

Hi everything works fine in grunt, except that the the Glyphicon and font-awesome files are not copied. The vendor.css (public/app/vendor.cssf) points to ../fonts/glyphicons . It should point to the bower_components folders though.

What do I need to change in order to make it work?

@khwerhahn

This comment has been minimized.

Show comment
Hide comment
@khwerhahn

khwerhahn Aug 7, 2014

I'n not too familiar with these grunt tasks. How can I tell grunt not to put any numbers in front of any files in the assets/fonts/ folder? That would fix my problem.

I'n not too familiar with these grunt tasks. How can I tell grunt not to put any numbers in front of any files in the assets/fonts/ folder? That would fix my problem.

@JaKXz

This comment has been minimized.

Show comment
Hide comment
@JaKXz

JaKXz Aug 8, 2014

Collaborator

I believe whenever you run grunt build the assets' files are given new names with unique IDs to make sure the latest version of the files are pushed to the client (rather than loading the cached version).

Collaborator

JaKXz commented Aug 8, 2014

I believe whenever you run grunt build the assets' files are given new names with unique IDs to make sure the latest version of the files are pushed to the client (rather than loading the cached version).

@khwerhahn

This comment has been minimized.

Show comment
Hide comment
@khwerhahn

khwerhahn Aug 8, 2014

ok i understand, but its not helpful, if the source can never find the target ^^. The fonts don't really change unless you update them. Is it possible to tell grunt to make an exception on the fonts file? So no unique ids...

ok i understand, but its not helpful, if the source can never find the target ^^. The fonts don't really change unless you update them. Is it possible to tell grunt to make an exception on the fonts file? So no unique ids...

@khwerhahn khwerhahn closed this Aug 9, 2014

@Kageetai

This comment has been minimized.

Show comment
Hide comment
@Kageetai

Kageetai Nov 6, 2014

Hey, did you find any solution for this? I have exactly the same problem...

Kageetai commented Nov 6, 2014

Hey, did you find any solution for this? I have exactly the same problem...

@khwerhahn

This comment has been minimized.

Show comment
Hide comment
@khwerhahn

khwerhahn Nov 7, 2014

Hey not really. Haven't really gotten to it. If you figure out something let me know.

Hey not really. Haven't really gotten to it. If you figure out something let me know.

@Kageetai

This comment has been minimized.

Show comment
Hide comment
@Kageetai

Kageetai Nov 7, 2014

I don't really understand all of the complex Gruntfile.js but I guess it should handle copying the fonts to the temporary folder or something...

Kageetai commented Nov 7, 2014

I don't really understand all of the complex Gruntfile.js but I guess it should handle copying the fonts to the temporary folder or something...

@behrad

This comment has been minimized.

Show comment
Hide comment
@behrad

behrad Feb 9, 2015

Solved it this way:

  1. Add webfonts to dist/public/assets by adding these into copy.dist.files:
{
          // include font-awesome webfonts
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>/bower_components/font-awesome',
          src: ['fonts/*.*'],
          dest: '<%= yeoman.dist %>/public/assets'
        },{
          // include bootstrap webfonts
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>/bower_components/bootstrap/dist',
          src: ['fonts/*.*'],
          dest: '<%= yeoman.dist %>/public/assets'
        }
  1. Remove webfonts from rev renaming by commenting the following line under rev.dist.file.source
'<%= yeoman.dist %>/public/assets/fonts/*'
  1. Fixing webfont paths from ../fonts to ../assets/fonts in usemin.options.patterns:
css: [
            [/(..\/fonts\/)/g, 'Fix webfonts path', function(match) {
              return match.replace('../fonts/', '../assets/fonts/');
            }]
          ]

behrad commented Feb 9, 2015

Solved it this way:

  1. Add webfonts to dist/public/assets by adding these into copy.dist.files:
{
          // include font-awesome webfonts
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>/bower_components/font-awesome',
          src: ['fonts/*.*'],
          dest: '<%= yeoman.dist %>/public/assets'
        },{
          // include bootstrap webfonts
          expand: true,
          dot: true,
          cwd: '<%= yeoman.client %>/bower_components/bootstrap/dist',
          src: ['fonts/*.*'],
          dest: '<%= yeoman.dist %>/public/assets'
        }
  1. Remove webfonts from rev renaming by commenting the following line under rev.dist.file.source
'<%= yeoman.dist %>/public/assets/fonts/*'
  1. Fixing webfont paths from ../fonts to ../assets/fonts in usemin.options.patterns:
css: [
            [/(..\/fonts\/)/g, 'Fix webfonts path', function(match) {
              return match.replace('../fonts/', '../assets/fonts/');
            }]
          ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment