Installation
meteor npm i --save meteor-package-import
Usage
This package is intended to be used with the babel plugin babel-plugin-replace-require
. Together, they can enable standard Meteor-style imports for Meteor packages from npm packages.
For example, you can write this standard Meteor code:
;console;
Instead of this:
const Meteor = globalPackage'meteor'Meteor;console;
Here's the required .babelrc
configuration:
API
importPackage(packageName: string)
:
Imports the specified package if available.
Throws a friendly error if the package is unavailable.
Example:
; const Meteor = Meteor;console;
Developing this package
This package uses typescript. You must have typescript installed (npm i -g typescript
) then compile the project by running tsc
.