Guy Bedford (2014-04-02T17:19:33.000Z)
domenic at domenicdenicola.com (2014-04-11T22:46:46.892Z)
On 1 April 2014 11:08, Jacob Gable <jacob.gable at gmail.com> wrote: > Finally, my real question is, can I achieve a "shimming" system like > requirejs (http://requirejs.org/docs/api.html#config-shim) has through > the creation of a custom Loader? It seems like the Instantiate method > could be overridden to potentially achieve something like this? It would > evaluate the code, then export the window.jQuery value as the instantiated > module? Functionality like this would be ideal for us since we would then > be able to only include the necessary vendor libraries on the page through > imports instead of making sure all were on the page already (or making page > specific vendor script builds). > Yes exactly, the instantiate hook allows an identical shim system to be created. So one can design a system something like - ```js System.shim['jquery'] = { exports: '$', deps: [] }; ``` With `System.import('jquery')` then working correctly.