in ox dev loader, allow for switching to build version by passing true as first argument (can be used to avoid boilerplate when choosing build/ or dev/ dynamically)
This commit is contained in:
parent
2efbc53b33
commit
80e0a02ea3
1 changed files with 19 additions and 11 deletions
|
@ -11,6 +11,13 @@
|
|||
path = getPath(),
|
||||
time = +new Date();
|
||||
|
||||
if (args[0] === true) {
|
||||
console.log('OK')
|
||||
path = path.replace(/dev\/$/, 'build/');
|
||||
loadScript('Ox.js', function() {
|
||||
Ox.load.apply(null, Ox.slice(args, 1));
|
||||
});
|
||||
} else {
|
||||
loadJSON(function(data) {
|
||||
var previousOx = global.Ox;
|
||||
loadScriptsSerial(data.files, function() {
|
||||
|
@ -23,6 +30,7 @@
|
|||
Ox.load.apply(null, args);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getPath() {
|
||||
var i, path, scripts = document.getElementsByTagName('script');
|
||||
|
|
Loading…
Reference in a new issue