javascript - baseUrl issue - requireJS -
i experiencing baseurl issue, 404 error, telling me root-app/js/module.js
not found. here's how comes
first, call
<script data-main="js/main" src="js/lib/requirejs/require.js"></script>
then in js/main.js
, have (for testing mean)
require({ paths: { upload: 'js/vendor/module.min' } }, ['js/vendor/main.js'], function(app) { app.add(2, 2); });
but in js/vendor/module.min.js
itself, there declarations define(["module"]...
, , 1 trigger 404 error. how can circumvent problem ? (sure, can move js/vendor/module.min
js/module.min
want keep code organized ;). necessary change define(["module"]...
define(["vendor/module"]...
?
in fact, problem here
paths: { upload: 'js/vendor/module.min' }
because of declaration define(["module"]
in js/vendor/module.min.js
suppose can't rename path uplaod
, expecting
paths: { module: 'js/vendor/module.min' }
Comments
Post a Comment