I'm developing a project using font-awesome and HarpJS. I'm just using the pre-compiled CSS version of font-awesome, but since I'm using bower it downloads even the LESS files to my components folder.
The problem is, when I need to compile my assets to a dist folder with harp compile
, it gives me this error:
{
"source": "Less",
"dest": "CSS",
"filename": "/Users/***/lib/fontawesome/less/bordered-pulled.less",
"lineno": 4,
"name": "NameError",
"message": "variable @fa-css-prefix is undefined",
"stack": "// Bordered & Pulled\n// -------------------------\n\n.@{fa-css-prefix}-border {\n padding: .2em .25em .15em;\n border: solid .08em @fa-border-color;\n border-radius: .1em;\n}\n\n.pull-right { float: right; }\n.pull-left { float: left; }\n\n.@{fa-css-prefix} {\n &.pull-left { margin-right: .3em; }\n &.pull-right { margin-left: .3em; }\n}\n"
}
This error is happening because HarpJS is trying to compile the LESS files that came with the font-awesome's bower package. After some research, I found this answer, which points me to a page of the font-awesome documentation that says:
Page: http://fontawesome.io/get-started/#custom-less
Open your project's font-awesome/less/variables.less
or font-awesome/scss/_variables.scss
and edit the @fa-font-path
or $fa-font-path
variable to point to your font directory.
Example:
@fa-font-path: "../font";
But I can't edit any file like this, since my dependencies are installed using bower and I don't check them in the repo. Even if I did check them in, that change would be overriden as soon as someone uses bower install
to get an updated version of font-awesome.
What workaround would you use for this situation?
TIP: You can reproduce this just by doing:
$ mkdir test
$ cd test
$ bower init
$ bower install --save font-awesome
$ harp compile . dist