aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

Bundle fonts #105

Closed bhaeussermann closed 8 years ago

bhaeussermann commented 8 years ago

Is there a font bundler?

I have fonts in eot, svg, ttf, woff, and woff2 formats in order to support multiple browsers. I would like to make one bundle for each font format containing all of its corresponding font files.

I tried bundling my fonts like this:

"bundles/fonts_woff2": {
    "includes": [
        "fonts/*.woff2!text"
    ],
    "options": {
        "inject": true,
        "minify": false,
        "depCache": false
    }
},

These files are binary files, so using the text plugin is probably wrong.

Nevertheless, the file paths are added to config.js and the contents of the font files are added to the bundle. However, the browser still loads each font indivually instead of loading the bundle file.

Is there a way to bundle fonts?

EisenbergEffect commented 8 years ago

This has much more to do with SystemJS than anything else. You can see their list of plugins here: https://github.com/systemjs/systemjs as well as read about how to create your own.