I need to use fontawesome in my custom theme.
Therefor I installed it by using yarn yarn add @fortawesome/fontawesome-free
When I'm trying to import it (@import "~@fortawesome"
) within the base.scss of my theme I get the following error:
In ThemeCompiler.php line 317:
[Shopware\Storefront\Theme\Exception\ThemeCompileException]
Unable to compile the theme "CustomTheme".~@fortawesome
file not found for @import: custom/plugins/CustomTheme/src/Resources/app/storefront/src/scss/base.scss on line 2, at column 1
Call Stack:
#0 import custom/plugins/CustomTheme/src/Resources/app/storefront/src/scss/base.scss (unknown file) on line 409
Can someone please tell me how to import fa correctly into my scss-file?
EDIT:
I installed fontawesome via npm inside my plugin under the following path plugin/src/Resources/app/storefront
.
To import it in my base.scss I can't simply use ./@fortawesome/...
like descirbed in the doc. I have to import the files like this ../../node_module/@fortawesome/...
instead.
The other problem is that the system can't find/load the webfonts of fa. I know that a solution would be to copy the fonts manually into my public folder but is there a way to make shopware copy them and put them into the public folder throughout the compiling process?