javascript - Multiple baseUrl in RequireJS config -
i have 2 locations javascript files, possible set 2 baseurls can move them later without having update loads of paths?
e.g.:
require.config({ baseurl: 'bower_components', paths: { backbone: 'backbone/backbone', underscore: 'underscore/underscore' } }); requirejs.config({ baseurl: 'js', paths: { main: 'main' } });
this format overwrites baseurl on sec call. declare 2 variables hold this, there more elegant, requirejs-ish way of doing this?
i don't believe possible. require's not going seek loading 1 base-url , fall retry others upon failure. if don't want paths in scripts' require
calls can consider specifying bundles
. see configuration docs. set path config app
js/main
.
javascript requirejs
No comments:
Post a Comment