stealjs / transpile

Transpiles from everything to everything else

Home Page:https://www.npmjs.com/package/transpile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add GLOBAL -> SLIM transpiler

m-mujica opened this issue · comments

If you use the current version on the slim branch, the global will be transpiled to amd then to slim; you'd get something like this:

screen shot 2017-05-25 at 11 18 15

which won't work.

The only reason the current global format is that gross is to support this style of global:

var MooTools = {};

Yep, it's for mootools. In transpile@2 we'll drop support for that. However, since slim is a new format we don't need to support it at all there.

So the way to do a global would be to inline the code directly in that function; that's it.