4

I have successfully installed the "font-awesome-sass" ruby-gem and included it via "require"-property inside the compass gunt-config and via "import"-rule in my scss. So the font-awesome scss gets compiled into my output-css file, this works so far.

My problem now: how do I get the font files (.woff, .otf, ..) from the ruby-gem into my grunt output directory. The files are already referenced inside the output-css as located in "../css/fonts/" directory but they don't get copied automatically.

Am I missing something?

shoesel
  • 1,198
  • 8
  • 15
  • I have exactly the same problem. Must be plenty of expert grunt users out there but none willing to impart the secrets of the trade to us n00bs. God knows how you're supposed to do it. I just installed font-awesome using bower and then manually moved the directories so they matched up with what's referenced in the outputted css. At least it works. – Inigo Feb 26 '15 at 12:01
  • When already using grunt, just use the npm module "font-awesome" and not the ruby-gem. After that you can just copy the content of "node_modules/font-awesome/fonts" into your target directory via grunt's copy task. To make it work with compass, you can import the content of "node_modules/font-awesome/scss" via "importPath"-parameter in grunt's compass-task. – shoesel Feb 27 '15 at 12:59

1 Answers1

0

I believe you could accomplish with something like grunt-contrib-copy

$ npm install grunt-contrib-copy

In your Gruntfile.js add a task like:

copy: {
  fonts: {
    src: 'path/to/font-awesome/files/*',
    dest: 'app/assets/fonts/font-awesome',
  },
},

As shoesel mentioned; if you are using grunt I would probably also use NPM packages or bower to pull in font-awesome. If you do, the path to your assets will be determined by the package used to install them. Adjust your paths to match your app setup obviously but the general idea should work.