Does require differ from import in meteor client build and how?

Hello !

I was trying to include Bootstrap from npm to my meteor app and I faced the famous Error: Bootstrap tooltips require Tether error.

My code was something like (in client/lib/imports.js):

import 'tether';
import 'bootstrap';

Then in saw Tether was not exposing itself to window, fine, I changed to:

import Tether from 'tether';
window.Tether = Tether;

import 'bootstrap';

But still, I was still getting the same error. After some research, I went to:

window.Tether = require('tether');

require('bootstrap');

and it was fixed, which kind of annoy me because the rest of the file is other global imports (jQuery plugins for the most). (e.g import 'jquery-validation';)

So how does Meteor behave if you use require rather import? Because it feels like all imports are treated first. I just don’t know if it’s normal to write that kind of code if you want to be full-ES6 compatible or is it just the way to be for now.

Your thoughts? Maybe I am doing it totally wrong and the usage of import and require are not used for the same purpose, advices are welcome :slight_smile:

I’ve been wondering about this myself,

Bump ? :slight_smile: