Вот мой bootstrap3 собственную структуру пакета, который работает, как ожидалось для меня:
bootstrap3
|-> dist (bootstrap3 directory containint js/, css/ and fonts/)
|-> bootstrap_override.css (override fonts paths)
|-> package.js (package definition)
bootstrap_override.css
@font-face{
font-family:'Glyphicons Halflings';
src:url('/packages/bootstrap3/dist/fonts/glyphicons-halflings-regular.eot');
src:url('/packages/bootstrap3/dist/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('/packages/bootstrap3/dist/fonts/glyphicons-halflings-regular.woff') format('woff'),
url('/packages/bootstrap3/dist/fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('/packages/bootstrap3/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
package.js
Package.describe({
summary:"bootstrap 3.0 packaged for Meteor."
});
Package.on_use(function(api){
api.use(["jquery"],"client");
//
api.add_files([
// bootstrap fonts
"dist/css/bootstrap.min.css",
"dist/css/bootstrap-theme.min.css", (optional bootstrap2 lookalike theme)
// bootstrap javascript
"dist/js/bootstrap.min.js"
],"client");
api.add_files([
"dist/fonts/glyphicons-halflings-regular.eot",
"dist/fonts/glyphicons-halflings-regular.ttf",
"dist/fonts/glyphicons-halflings-regular.svg",
"dist/fonts/glyphicons-halflings-regular.woff"
],"client",{
// undocumented hint : do not bundle those files along with with js/html resources
isAsset:true
});
api.add_files([
// overriding css
"bootstrap_override.css"
],"client");
});
Этот пакет указать, что шрифты - это специальные ресурсы, которые не должны быть связаны с клиентом вместе с регулярными js/html, цитируя ядро Dev David Glasser, «он должен быть необработанным и отдельно извлекаемым». (см. https://github.com/meteor/meteor/issues/1357)
Файл bootstrap_override.css необходим для переопределения путей родственников по умолчанию, определенных в bootstrap.css, с нашими абсолютными путями, связанными с пакетом.
Вы также можете использовать пакет bootstrap-3 из атмосферы. (https://atmosphere.meteor.com/package/bootstrap-3)
Большое спасибо! Это сработало. Я все еще новичок Meteor. – David
Мы все были в какой-то момент. За исключением Мэтта. –