I have been working around with yeoman and I have generated a webapp with yeoman webapp generator and have added font-awesome and bootstrap-css with bower install. Also I have run grunt bowerInstall
to update the index.html
file.
Now when I launch the app with grunt serve
everything works fine. Just a sample given below
But when I do a grunt build and launch it with grunt serve:dist
the icons are missing.
I understand that the font files are not copied from the error logs in the console. Looing into gruntjs file I guess Yeoman generates only tasks to copy the fonts under style/fonts of the app directory and I've to add my own copy task to copy font files.
{
expand: true,
dot: true,
cwd: '<%= config.app %>',
dest: '<%= config.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'images/{,*/}*.webp',
'{,*/}*.html',
'styles/fonts/{,*/}*.*'
]
}
So the question is,
Why the task to copy bower_component/*/fonts/** to dist directory not included as this looks obvious considering the app fonts are copied using
styles/fonts/{,*/}*.*
Is there a Yeoman/grunt specific configuration which can be included to copy this files.(Note: I already have a written a task to copy the font files as below. I would like to know whether there is a alternate way)
{ expand: true, dot: true, cwd: '<%= config.bower %>', flatten:true, dest: '<%= config.dist %>/fonts', src: [ '{,*/}/fonts/{,*/}*.*' ] }
Thanks in advance.