Skip to content

Instantly share code, notes, and snippets.

@junosuarez
Last active December 14, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save junosuarez/5053228 to your computer and use it in GitHub Desktop.
Save junosuarez/5053228 to your computer and use it in GitHub Desktop.
({
baseUrl: './src/',
dir: 'build',
include: ['main'],
logLevel: 0,
mainConfigFile: './src/main.js',
name: 'main',
wrap: false,
optimize: 'none',
preserveLicenseComments: false
})
/** @license MIT License (c) copyright B Cavalier & J Hann */
/**
* A lightweight CommonJS Promises/A and when() implementation
* when is part of the cujo.js family of libraries (http://cujojs.com/)
*
* Licensed under the MIT License at:
* http://www.opensource.org/licenses/mit-license.php
*
* @version 1.7.1
*/
(function(e){e([],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,s)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(r){return s(r)}});return n}function s(e){var n=new r(function(n,r){try{return r?t(r(e)):s(e)}catch(i){return s(i)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function i(e){return d(s(e))}function u(e){return p(e)}var a,f,l,c,h,p,d;return f=new r(e),a={then:e,resolve:n,reject:i,progress:u,promise:f,resolver:{resolve:n,reject:i,progress:u}},l=[],c=[],h=function(e,t,n){var r,i;return r=o(),i=typeof n=="function"?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),c.push(i),r.promise},p=function(e){return v(c,e),e},d=function(e){return e=t(e),h=e.then,d=t,p=g,v(l,e),c=l=E,e},a}function u(e){return e&&typeof e.then=="function"}function a(t,n,r,i,s){return m(2,arguments),e(t,function(t){function u(e){v(e)}function a(e){d(e)}var f,l,c,h,p,d,v,m,y,b;y=t.length>>>0,f=Math.max(0,Math.min(n,y)),c=[],l=y-f+1,h=[],p=o();if(!f)p.resolve(c);else{m=p.progress,v=function(e){h.push(e),--l||(d=v=g,p.reject(h))},d=function(e){c.push(e),--f||(d=v=g,p.resolve(c))};for(b=0;b<y;++b)b in t&&e(t[b],a,u,m)}return p.then(r,i,s)})}function f(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return a(e,1,i,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,y).then(t,n,r)}function c(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,i,s,u,a,f;s=i=t.length>>>0,r=[],f=o();if(!s)f.resolve(r);else{u=function(t,i){e(t,n).then(function(e){r[i]=e,--s||f.resolve(r)},f.reject)};for(a=0;a<i;a++)a in t?u(t[a],a):--s}return f.promise})}function p(t,n){var r=w.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,s){return e(t,function(t){return e(r,function(e){return n(t,e,s,i)})})},b.apply(t,r)})}function d(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),s(e)},n.progress)}function v(e,t){var n,r=0;while(n=e[r++])n(t)}function m(e,t){var n,r=t.length;while(r>e){n=t[--r];if(n!=null&&typeof n!="function")throw new Error("arg "+r+" must be a function")}}function g(){}function y(e){return e}var b,w,E;return e.defer=o,e.resolve=t,e.reject=n,e.join=c,e.all=l,e.map=h,e.reduce=p,e.any=f,e.some=a,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(E,t)})})}},w=[].slice,b=[].reduce||function(e){var t,n,r,i,s;s=0,t=Object(this),i=t.length>>>0,n=arguments;if(n.length<=1)for(;;){if(s in t){r=t[s++];break}if(++s>=i)throw new TypeError}else r=n[1];for(;s<i;++s)s in t&&(r=e(r,t[s],s,t));return r},e})})(typeof define=="function"&&define.amd?define:function(e){typeof exports=="object"?module.exports=e():this.when=e()});
define("../lib/when", function(){});
/** @license MIT License (c) copyright B Cavalier & J Hann */
/**
* A lightweight CommonJS Promises/A and when() implementation
* when is part of the cujo.js family of libraries (http://cujojs.com/)
*
* Licensed under the MIT License at:
* http://www.opensource.org/licenses/mit-license.php
*
* @version 1.7.1
*/
(function(e){e([],function(){function e(e,n,r,i){return t(e).then(n,r,i)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=i(e),t}function n(t){return e(t,s)}function r(e){this.then=e}function i(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(r){return s(r)}});return n}function s(e){var n=new r(function(n,r){try{return r?t(r(e)):s(e)}catch(i){return s(i)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return d(e)}function i(e){return d(s(e))}function u(e){return p(e)}var a,f,l,c,h,p,d;return f=new r(e),a={then:e,resolve:n,reject:i,progress:u,promise:f,resolver:{resolve:n,reject:i,progress:u}},l=[],c=[],h=function(e,t,n){var r,i;return r=o(),i=typeof n=="function"?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,i)}),c.push(i),r.promise},p=function(e){return v(c,e),e},d=function(e){return e=t(e),h=e.then,d=t,p=g,v(l,e),c=l=E,e},a}function u(e){return e&&typeof e.then=="function"}function a(t,n,r,i,s){return m(2,arguments),e(t,function(t){function u(e){v(e)}function a(e){d(e)}var f,l,c,h,p,d,v,m,y,b;y=t.length>>>0,f=Math.max(0,Math.min(n,y)),c=[],l=y-f+1,h=[],p=o();if(!f)p.resolve(c);else{m=p.progress,v=function(e){h.push(e),--l||(d=v=g,p.reject(h))},d=function(e){c.push(e),--f||(d=v=g,p.resolve(c))};for(b=0;b<y;++b)b in t&&e(t[b],a,u,m)}return p.then(r,i,s)})}function f(e,t,n,r){function i(e){return t?t(e[0]):e[0]}return a(e,1,i,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,y).then(t,n,r)}function c(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,i,s,u,a,f;s=i=t.length>>>0,r=[],f=o();if(!s)f.resolve(r);else{u=function(t,i){e(t,n).then(function(e){r[i]=e,--s||f.resolve(r)},f.reject)};for(a=0;a<i;a++)a in t?u(t[a],a):--s}return f.promise})}function p(t,n){var r=w.call(arguments,1);return e(t,function(t){var i;return i=t.length,r[0]=function(t,r,s){return e(t,function(t){return e(r,function(e){return n(t,e,s,i)})})},b.apply(t,r)})}function d(t,n,r){var i=arguments.length>2;return e(t,function(e){return e=i?r:e,n.resolve(e),e},function(e){return n.reject(e),s(e)},n.progress)}function v(e,t){var n,r=0;while(n=e[r++])n(t)}function m(e,t){var n,r=t.length;while(r>e){n=t[--r];if(n!=null&&typeof n!="function")throw new Error("arg "+r+" must be a function")}}function g(){}function y(e){return e}var b,w,E;return e.defer=o,e.resolve=t,e.reject=n,e.join=c,e.all=l,e.map=h,e.reduce=p,e.any=f,e.some=a,e.chain=d,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(E,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(E,t)})})}},w=[].slice,b=[].reduce||function(e){var t,n,r,i,s;s=0,t=Object(this),i=t.length>>>0,n=arguments;if(n.length<=1)for(;;){if(s in t){r=t[s++];break}if(++s>=i)throw new TypeError}else r=n[1];for(;s<i;++s)s in t&&(r=e(r,t[s],s,t));return r},e})})(typeof define=="function"&&define.amd?define:function(e){typeof exports=="object"?module.exports=e():this.when=e()})
@junosuarez
Copy link
Author

As you can see, r.js is writing it as define("../lib/when", function(){});, but the minified form of when.js still has it's call to define (using the implicit module name signature).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment