Skip to content

Commit

Permalink
Properly support use from Meteor packages
Browse files Browse the repository at this point in the history
- Applied Tim Heckel's packaging trick

- Better comments

closes #420 and closes #419
  • Loading branch information
Graeme Pyle authored and stoeffel committed May 3, 2015
1 parent 09ba69b commit b67b50c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions meteor-post.js
@@ -0,0 +1,2 @@
// s will be picked up by Meteor and exported
s = module.exports;
6 changes: 6 additions & 0 deletions meteor-pre.js
@@ -0,0 +1,6 @@
// Defining this will trick dist/underscore.string.js into putting its exports into module.exports
// Credit to Tim Heckel for this trick - see https://github.com/TimHeckel/meteor-underscore-string
module = {};

// This also needed, otherwise above doesn't work???
exports = {};
4 changes: 3 additions & 1 deletion package.js
Expand Up @@ -8,7 +8,9 @@ Package.describe({
documentation: 'README.markdown'
});


Package.onUse(function (api) {
api.versionsFrom('METEOR@1.0');
api.addFiles('dist/underscore.string.js');
api.addFiles(['meteor-pre.js','dist/underscore.string.js','meteor-post.js']);
api.export("s");
});

0 comments on commit b67b50c

Please sign in to comment.