meteor - Public static assets in module folders? -
i want organize meteor app in modules, i.e. having folder each specific section or functionality of app containing related files.
this preferably include static assets such images special public/
folder seems work in project root.
or missing something?
for project, feels overkill (less clean, even) having overhead of creating proper package every little module of app.
unfortunately way use package. can add static assets package, , file can accessed url: /packages/[package name]/[path file]
. here's example of package.js
hopscotch:
package.describe({ summary: 'a framework make easy developers add product tours.' }); package.onuse(function(api) { api.versionsfrom('1.0.0'); api.addfiles('img/sprite-green.png', 'client'); api.addfiles('img/sprite-orange.png', 'client'); api.addfiles('css/hopscotch.css', 'client'); api.addfiles('js/hopscotch.js', 'client'); });
as can see, of images under img
directory within package. access sprite-green.png
file, use /packages/hopscotch/img/sprite-green.png
.
Comments
Post a Comment