Meteor 1.2无法从包中加载字体

时间:2016-03-24 13:41:52

标签: meteor fontello

我刚刚升级到Meteor 1.2.1。我有一个本地的fontello软件包,其中的图标不再显示在屏幕上。

package.js文件的路径是:

/packages/fontello/package.js

此文件的内容为:

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');
});

我似乎无法理解为什么会这样?

1 个答案:

答案 0 :(得分:0)

我发现这是因为我需要将addFiles用于文件扩展名而不是addAssets用于css文件:

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");
});