Riiskits / Riiskit-Child

A child theme for Riiskit.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Figure out how to make JS libraries with AMD support work with ES6 with babel

sigurdsvela opened this issue · comments

Most big JS libraries come with AMD & CommonJS support. They check for an environment variable, and if it exists for a specific module loader type, it exports the module according to the module loader type.

But, for some reason, this does not work with ES6 with babel set to use RequiresJS. The way to do this now is to force the library that you are trying to load to export to window and then write export window.yourLibrary, and then compile the library with bable.

This is an out of this world terrible solution, so a better solution is needed.

Related to #2