Created
September 20, 2013 13:00
-
-
Save anonymous/6637121 to your computer and use it in GitHub Desktop.
I can`t do this work! I would like to use multiversion with separate files. Main execution should alert "1.1" and the "1.2", but I obtain "1.1" always. ¿Anyone know how to accomplish that? I'm lost... :-/
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(root){ | |
root.foo = { | |
VERSION: '1.1' | |
} | |
}(this)); |
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(root){ | |
root.foo = { | |
VERSION: '1.2' | |
} | |
}(this)); |
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
require.config({ | |
context: null, | |
paths: { | |
foo: 'foo-1.1' | |
}, | |
shim: { | |
foo: { | |
exports: 'foo' | |
} | |
} | |
}); | |
require(['foo'], function(foo){ | |
alert(foo.VERSION); | |
require(['mymodule'], function(mymodule) { | |
alert(mymodule.VERSION); | |
}); | |
}); | |
define('main', function(){}); |
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
require.config({ | |
context: 'test', | |
paths: { | |
foo: 'foo-1.2' | |
}, | |
shim: { | |
foo: { | |
exports: 'foo' | |
} | |
} | |
}); | |
define('mod',['foo'], function(foo) { | |
return { | |
VERSION: foo.VERSION | |
} | |
}); | |
define('mymodule', ['mod'], function(module){ | |
return module; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment