# Steal-tools build bundling font-awesome fonts

**URL:** <https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755>\
**Category:** StealJS\
**Created:** [November 15, 2017, 2:57pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755 "2017-11-15T14:57:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [November 15, 2017, 2:57pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/1 "2017-11-15T14:57:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [November 15, 2017, 4:40pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/2 "2017-11-15T16:40:21Z")

</div>

I managed to solve this on my own using the steal-bundler package.

I add this to the build script

```
bundleAssets(buildResult, {
    infer: false,
    glob: ['node_modules/font-awesome/fonts/*']
});

```

This has copied the node\_modules/font-awesome/fonts files to the dist directory and updated the references in the app.css file (nice).

If there is another more valid solution, then please let me know.

Cheers

Rob

---

<div class="post-metadata">

**Author:** ![chasen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/chasen/32/402_2.png) [@chasen](https://forums.bitovi.com/u/chasen)\
**Post date:** [November 15, 2017, 6:54pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/3 "2017-11-15T18:54:38Z")

</div>

Hey @robfoweraker, I think that’s the viable solution, although I’d kinda want to poke around a sample project (or at least see your build script) to see what’s going on.

[Also please ask all the questions, we’re happy to help. 😊]

---

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [November 15, 2017, 8:20pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/4 "2017-11-15T20:20:18Z")

</div>

I will put together a cut down example based on the project and share it somewhere. I’ll be away from work for a few days, so it will be towards the end of next week before I get round to it.

Many thanks

Rob

---

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [November 23, 2017, 8:45pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/5 "2017-11-23T20:45:14Z")

</div>

Hi @chasen,

I put a sample project up, if you still want to take a look.

[https://github.com/rob4acre/can3-steal-docker](https://github.com/rob4acre/can3-steal-docker)

We are using docker to manage the build and run the web server. The project should contain all that is needed, the README contains the instructions for getting the frontend running.

Cheers

Rob

---

<div class="post-metadata">

**Author:** ![chasen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/chasen/32/402_2.png) [@chasen](https://forums.bitovi.com/u/chasen)\
**Post date:** [December 11, 2017, 11:25pm UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/6 "2017-12-11T23:25:51Z")

</div>

Hi @robfoweraker, my apologies for not responding sooner. Thanks for posting the sample project!

This is probably a bug with steal-bundler. I filed an issue here: [https://github.com/stealjs/steal-bundler/issues/37](https://github.com/stealjs/steal-bundler/issues/37)

---

<div class="post-metadata">

**Author:** ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)\
**Post date:** [December 12, 2017, 8:28am UTC](https://forums.bitovi.com/t/steal-tools-build-bundling-font-awesome-fonts/755/7 "2017-12-12T08:28:40Z")

</div>

Hi @chasen  
Thanks for taking a look at the sample. I will follow the issue  
Cheers  
Rob
