- Notifications
You must be signed in to change notification settings - Fork574
Overriding System Loader behavior
ry edited this pageDec 11, 2014 ·4 revisions
To supply new functions forSystem functions, extendTraceurLoader and override the functionsnormalize,locate,fetch,translate orinstantiate. The first three are supported and we'll fix any bugs against them. Thetranslate andinstantiate are called but probably don't do what the standard expects.
For example, you might do something like
import{webLoader}from'./webLoader';classMyLoaderextendsTraceurLoader{constructor(){super(webLoader,window.location.href);}normalize(name){// bah I am normal!returnname;}}System=newMyLoader();
See alsohttp://wiki.ecmascript.org/doku.php?id=harmony:module_loaders