It’s me again, another question (sorry).
I’m using steal-tools@1.3.3 to bundle the frontend app. One of the dependencies is font-awesome@4.7.0. This is working fine when using steal to load everything.
It had been working fine in production too, but then I decided that the node_modules directory shouldn’t really be included in the production container. So it turns out that the font-awesome fonts directory is not being added to the production bundle and so the fonts cannot load when the node_modules directory is not present in the container.
My colleague suggested using the bundleAssets option with steal-tools. Once I added this, then I see that steal-tools is trying to add the fonts (i think). I see the following warning.
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, lstat '/opt/wsp/fonts/glyphicons-halflings-regular.eot'
In the code, I am importing the font-awesome css file like this
import 'font-awesome/css/font-awesome.css';
This file references the fonts like this:
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
The fonts directory is installed in
node_modules/font-awesome/fonts
Any ideas? I can work around this by mounting the node_modules/font-awesome/fonts directory in the production container, but this seems wrong and I would like to understand if this is a problem or not.
Cheers
Rob