Requirejs 需要更改同一文件上的baseUrl

Requirejs 需要更改同一文件上的baseUrl,requirejs,Requirejs,我有以下文件结构: |- index.html vendor |- jquery.min.js (some libraries) js |- app.js 当我尝试使用以下url从浏览器加载index.html时: http://localhost/~myname/WebFrontend/ 我在conf.js中得到以下错误(请参阅conf.js上的注释) 我应该如何解决这个问题 不确定是否可以更改同一文件上的baseUrl。 而且,如果您加载了另一个模块,我

我有以下文件结构:

|- index.html
   vendor
    |- jquery.min.js (some libraries)
   js
    |- app.js 
当我尝试使用以下url从浏览器加载index.html时:

http://localhost/~myname/WebFrontend/ 
我在
conf.js
中得到以下错误(请参阅conf.js上的注释)

我应该如何解决这个问题



不确定是否可以更改同一文件上的baseUrl。
而且,如果您加载了另一个模块,我认为您无法更改baseUrl

无论如何:

1) 您说过jquery模块已成功加载。
这是错误的,因为您不会因为
require(['../js/app'])而得到错误失败。
2) 根据您的结构,我建议定义
baseUrl:'./'


通过这种方式,您将能够访问制作
vendor/filename
的供应商模块和制作
js/filenane
的源文件,您的意思是找不到app.js还是真的是router.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