gpt4 book ai didi

javascript - requireJs订单插件: can it exist in a different path than the require. js basePath?

转载 作者:行者123 更新时间:2023-12-02 22:40:23 25 4
gpt4 key购买 nike

使用订单插件时,require.js 在给定的 basePath/order.js 中查找它

示例:

require(
{
baseUrl: '/public/js/'
},
[
'require',
'order!http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.1.7/underscore-min.js',
'order!http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.3/backbone-min.js',
'order!http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js'
],
function (require) {
require(['application'], function (app) {
app.run();
});
}
);

它在http://url.com/public/js/order.js中查找订单插件,我可以以某种方式将其存储在我的javascript文件夹的根目录中吗?

最佳答案

您可以将插件放置在您喜欢的任何位置,并在配置 RequireJS 时指向它们的路径:

require({
baseUrl: "/public/js/",
paths: {
order: "requirejs/plugins/order"
},
...

关于javascript - requireJs订单插件: can it exist in a different path than the require. js basePath?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7363379/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com