RequireJSが "パス"設定を無視するのはなぜですか?
define([
"require",
"jq",
"jqui",
"jqs",
"jlb",
"jl",
"app/blogapp/bap"
],
function(
require,
$,
jLayout,
bap
){
'use strict';
jQuery(function($) {
var container = $('.layout');
function layout() {
container.layout({
resize: false,
type: 'border',
vgap: 8,
hgap: 8
});
};
$('.east').resizable({
handles: 'w',
stop: layout,
resize: layout
});
$('.west').resizable({
handles: 'e',
stop: layout,
resize: layout
});
$(window).resize(layout);
layout();
layout();
});
var BlogApp = require("app/blogapp/bap");
var blog = BlogApp.createApp();
blog.start(options);
},
function(
err
){
//The errback, error callback
//The error has a list of modules that failed
var failedId = err.requireModules && err.requireModules[0];
console.log("In err "+failedId);
console.log(err);
}
);
define(function (
require
){
var tk=require("tk");
var bb=require("bb");
var ba = tk.App.extend({
initialize: function() {},
});
return ba;
},
function(
err
){
//The errback, error callback
//The error has a list of modules that failed
var failedId = err.requireModules && err.requireModules[0];
console.log("In err "+failedId);
console.log(err);
}
);
を次のようにAPP/blogapp/BAPである
を次のようにメイン
requirejs.config({
baseUrl: "assets/js/",
paths: {
"jq" : "lib/jquery/jquery",
"jqui" : "lib/jquery/jquery-ui-1.10.4",
"jl" : "lib/jquery/jquery.jlayout",
"jlb" : "lib/jquery/jlayout.border",
"jqs" : "lib/jquery/jquery.sizes",
"bb" : "lib/marionette/backbone",
"js2" : "lib/json2/json2",
"bbr" : "lib/marionette/backbone.radio",
"mt" : "lib/marionette/backbone.marionette",
"tk" : "lib/marionette/marionette.toolkit",
"us" : "lib/underscore/underscore",
"tpl" : "lib/tpl/tpl"
},
waitSeconds: 20,
shim: {
"jqui":{
deps: ['jq']
},
"jl":{
deps: ['jq']
},
"jqs":{
deps: ['jq']
},
"jlb":{
deps: ['jq']
},
"us": {
exports: "_"
},
"bb": {
exports: ["Backbone"],
deps: ['jq','us','js2']
},
"bbr":{
exports: ["Radio"],
deps: ["bb"]
},
"mt": {
exports: "Marionette",
deps: ["bb","bbr"]
},
"tk": {
exports: "Toolkit",
deps: ["mt"]
}
},
deps: ['app/main']
});
アプリが/で次のように私が設定を持っているように、salamu-alikum
次のエラーが発生しました
GET file:///C:/Users/Nadvi/Desktop/blog.org/assets/js/backbone.js net::ERR_FILE_NOT_FOUND
req.load @ require.js:2102
load @ require.js:1784
load @ require.js:900
fetch @ require.js:890
check @ require.js:922
enable @ require.js:1246
enable @ require.js:1644
(anonymous) @ require.js:1231
(anonymous) @ require.js:136
each @ require.js:61
enable @ require.js:1183
init @ require.js:851
callGetModule @ require.js:1273
completeLoad @ require.js:1677
onScriptLoad @ require.js:1823
require.js:388 function hasPathFallback(backbone)
require.js:170 Uncaught Error: Script error for "backbone", needed by: bbr
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:170)
at HTMLScriptElement.onScriptError (require.js:1844)
Uncaught Error: Load timeout for modules: tk,mt
http://requirejs.org/docs/errors.html#timeout
at makeError (require.js:170)
at checkLoaded (require.js:743)
at require.js:769
makeError @ require.js:170
checkLoaded @ require.js:743
(anonymous) @ require.js:769
setTimeout (async)
checkLoaded @ require.js:767
(anonymous) @ require.js:769
setTimeout (async)
checkLoaded @ require.js:767
(anonymous) @ require.js:769
setTimeout (async)
checkLoaded @ require.js:767
(anonymous) @ require.js:769
setTimeout (async)
checkLoaded @ require.js:767
(anonymous) @ require.js:769
ここで間違っていることは、backbone.jsのパスが間違っていることを理解できません。私を助けてください。
Zazakallahマウラヴィ
Nadvi
'輸出:[ "バックボーン"]は、' - それは奇妙な構文ですが、それはすべきではない: '輸出: "バックボーン"'? – mikeapr4