You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 2nd case, ironically, is more complicated to me. If I use the above ‘get_global_lodash’ trick, and since inside almond fake-loader, how can I load the real ‘lodash’?
It works fine but it’s a shame to need shim to run AMD code!
Does anyone have an idea of what pattern to use ? I want to avoid having two sep builds (AMD and plain).
Any help will be greatly appreciated, as I am looking to generalize it enough and include it to uRequire (https://github.com/anodynos/uRequire), the Universal Module Converter I am also developing.
The text was updated successfully, but these errors were encountered:
Check anodynos/uBerscore#1 & https://groups.google.com/forum/?fromgroups#!topic/requirejs/NJ8A8SIffW0
With https://github.com/anodynos/uBerscore as an example, I want to have a single optimized build, as a single uBerscore.js that runs both:
_
been loaded before). Its exporting_B
as a global.OR
I decided to use almond.js to achieve this 2-fold single build.
For the 1st case to work, since I don’t want to include ‘lodash’ in the build I tricked build.js to {paths: { lodash: "get_global_lodash" }} where get_global_lodash.js simply returns the global
window._
. (example https://github.com/anodynos/uBerscore/blob/master/source/examples/uBerscoreExample_almondJS_noAMD.html)The 2nd case, ironically, is more complicated to me. If I use the above ‘get_global_lodash’ trick, and since inside almond fake-loader, how can I load the real ‘lodash’?
The only way I have found so far is to use {shim : {uBerscore: { deps: ['lodash'], exports: "_B" }}, that loads ‘lodash’ from the ‘external ‘ requirejs. Example https://github.com/anodynos/uBerscore/blob/master/source/examples/uBerscoreExample_almondJS_AMD.html
It works fine but it’s a shame to need shim to run AMD code!
Does anyone have an idea of what pattern to use ? I want to avoid having two sep builds (AMD and plain).
Any help will be greatly appreciated, as I am looking to generalize it enough and include it to uRequire (https://github.com/anodynos/uRequire), the Universal Module Converter I am also developing.
The text was updated successfully, but these errors were encountered: