-
-
Save webpro/b23b73522a5cb7ff3b85 to your computer and use it in GitHub Desktop.
Boot with curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var debug = false, | |
legacy = false, | |
preloads = []; | |
var scripts = document.getElementsByTagName('script'), | |
script = scripts[scripts.length - 1], | |
src = script.src, | |
srcParts = src.split('/'), | |
srcFile = srcParts.pop(), | |
basePath = srcParts.length ? srcParts.join('/') + '/' : './'; | |
if(script.attributes.debug || window.location.search.indexOf('debug') > -1) { | |
debug = true; | |
preloads.push('core/debug'); | |
} | |
// See which shims we need | |
if(typeof Array.prototype.map !== 'function' || typeof Function.prototype.bind !== 'function' || typeof Object.preventExtensions !== 'function') { | |
legacy = true; | |
preloads.push('core/legacy'); | |
} | |
curl({ | |
preloads: preloads, | |
paths: { | |
'core/bootstrap': basePath + 'bootstrap', | |
'core/debug': basePath + 'debug', | |
'core/legacy': basePath + 'legacy', | |
'core/util': basePath + 'util' + (legacy ? '.legacy' : ''), | |
'core_util': basePath + 'util' | |
} | |
}); | |
define('core/core', ['core/bootstrap'], function(bootstrap) { | |
return { | |
version: 'dev', | |
debug: debug, | |
legacy: legacy, | |
boot: bootstrap | |
} | |
}); | |
define('core', ['core/core'], function(core) { | |
return core; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment