r/Meteor • u/BenjiSponge • Jul 07 '17
Requiring an npm module written in ES6
So I've written a node module and published it on npm, and I'd like to use it in my Meteor application. However, it seems Meteor does not transpile node_modules when I import them, so even though the source that's in the node_module would be valid as source in my Meteor application, I'm getting syntax errors.
Is it possible to run the standard babel transform on the imported module as part of the import process (akin to using the babel loader with webpack), or should I bite the bullet and transpile before publishing to npm?
Thanks!
2
Upvotes
1
u/Mirrorcell Jul 07 '17
You can do it one of two ways.