Search code examples
meteorfontello

Meteor 1.2 cannot load fonts from package


I have just upgraded to Meteor 1.2.1 . I have a local fontello package where the icons are no longer showing on the screen.

The path to the package.js file is:

/packages/fontello/package.js

The content of this file is:

Package.describe({
    name: 'fontello',
    version: '0.0.1',
    summary: '',
    git: '',
    documentation: 'README.md'
});

Package.onUse(function(api) {
    api.versionsFrom('1.0.3.1');
    api.addAssets('css/fontello.css', "client");
    api.addAssets('css/animation.css', "client");
    api.addAssets('font/fontello.eot', "client");
    api.addAssets('font/fontello.svg', "client");
    api.addAssets('font/fontello.ttf', "client");
    api.addAssets('font/fontello.woff', "client");
});

Package.onTest(function(api) {
    api.use('tinytest');
    api.use('fontello');
    api.addFiles('fontello-tests.js');
});

I can't seem to understand why this is?


Solution

  • I figured out that this was because I needed to use addFiles for file extensions instead of addAssets for the css files:

    Package.onUse(function(api) {
        api.versionsFrom('1.0.3.1');
        api.addFiles('css/fontello.css', "client");
        api.addFiles('css/animation.css', "client");
        api.addAssets('font/fontello.eot', "client");
        api.addAssets('font/fontello.svg', "client");
        api.addAssets('font/fontello.ttf', "client");
        api.addAssets('font/fontello.woff', "client");
    });