So I'm in the situation where I have added a font to my Yeoman
project. There is however a small problem. Whenever I run grunt build
the file name of my font is changed, but it doesn't change in my CSS
causing it to not work.
How can I fix this. I know that I have to look inside my Gruntfile.js
but I have no idea where to look.
I already tried this:
// Performs rewrites based on rev and the useminPrepare configuration
usemin: {
html: ['<%= yeoman.dist %>/public/{,*/}*.html'],
css: ['<%= yeoman.dist %>/public/{,*/}*.css'],
js: ['<%= yeoman.dist %>/public/{,*/}*.js'],
options: {
assetsDirs: [
'<%= yeoman.dist %>/public',
'<%= yeoman.dist %>/public/assets/images',
'<%= yeoman.dist %>/public/assets/fonts'
],
// This is so we update image references in our ng-templates
patterns: {
js: [
[/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
],
css: [
[/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the CSS to reference our revved images']
]
}
}
},
Because I figured that if I could have it change the name in my CSS aswell it might work. But this doesn't really fix anything :-(
UPDATE
As requested here is the changes in the file name
Before:
ITCEDSCR.TTF
After
20118b60.ITCEDSCR.TTF
According to https://github.com/yeoman/generator-webapp/issues/459 ->
{
usemin: {
options: {
assetsDirs: [
'<%%= config.dist %>',
'<%%= config.dist %>/images',
'<%%= config.dist %>/styles'
]
},
html: ['<%%= config.dist %>/{,*/}*.html'],
css: ['<%%= config.dist %>/styles/{,*/}*.css']
}
}
Getting rid of the fonts should help I guess ?