我有以下文件结构:
|- index.html
vendor
|- jquery.min.js (some libraries)
js
|- app.js
当我尝试使用以下网址从浏览器加载 index.html 时:
http://localhost/~myname/WebFrontend/
我收到以下错误conf.js
(请参阅 conf.js 上的评论)。
我应该如何解决这个问题?
// index.html
<script data-main="js/conf" src="./vendor/require.js"></script>
// conf.js
requirejs.config({
baseUrl: '../vendor',
paths: {
jquery: 'jquery.min', // it works
}
});
require(['../js/app']); // http://localhost/~mynane/js/router.js not found
require(['./js/app']); // http://localhost/~myname/vendor/js/router.js not found
// I would like to point to http://localhost/~antoniopierro/WebFrontend/js/router.js