do i need to add babel integration to it in order to use ES6 ? if yes how to add it seemlessly with a meteor project ?
If you’ve added the “ecmascript” package (
meteor add ecmascript) it should be able to transpile es2015 (aka es6) to es5 without any more effort.
how you import/require meteor stuff inside node_modules ?
If you mean importing something from node modules: When you
import it automatically looks inside
./node_modules if you didn’t give a specific path but just a packge name. So when you do
npm install some-package, it gets installed into
./node_modules/some-package/. When you
import someVar from 'some-package' it will import the file declared in
./node_modules/some-package/package.json "main" field.
If you mean importing a Meteor API from inside an npm package: I believe you should just be able to import it via `import Meteor from ‘meteor/meteor’ like you normally would
more generally how do you integrate custom node_modules with meteor ?
if you mean that you have an npm package that’s published to npm and you want to install it, you can just install it like any other npm package with
npm install your-package-name. Otherwise if you have a package that isn’t published to npm but it’s in a git repo somewhere (like on your github), you can add it to your package.json pointing right to your repo like
and then just do
npm install, it’ll be installed to
./node_modules/your-package-name/ and you’ll be able to import it like
import something from 'your-package-name'
hope that helps