## Loader Hooks ### Hooking the Loader The loader is designed to be hookable in a very light-weight way using only function extensions. The standard pattern for this is: ```js const existingHook = System.constructor.prototype.hookName; System.constructor.prototype.hookName = function (args) { return Promise.resolve(existingHook.call(this, args)) .then(function (existingHookResult) { // custom hook here return ...; }); }; ``` When hooking the loader it is important to pay attention to the order in which hooks will apply, and to keep existing hooks running where they provide necessary functionality. In addition, some hooks are Promise-based, so Promise chaining also needs to be carefully applied only where necessary. #### createContext(url) -> Object Used to populate the `import.meta` for a module, available at `_context.meta` in the [System.register module format](system-register.md). The default implementation is: ```js System.constructor.prototype.createContext = function (url) { return { url }; }; ``` #### createScript(url) -> HTMLScriptElement | Promise\ When SystemJS loads a module, it creates a `