I have been encountering load timeout errors with Require in my application. I am using grunt to build my require files and the require optimizer. I have set a waitseconds parameter and it has resolved the timeouts issue on my local environment, but the problem persists in production. Although I have specified the waitseconds in my grunt file and even tried in my main js file, I cannot locate where this value is being applied to the active script files. Can anyone guide me on where to find this value in production? It does not seem to be written to the require.js file when grunt executes the task, nor is it included in my main.js file during the require and optimizer processes. Where does the browser pick up this value from? I notice the default 7-second timeout in the require.js file in production, but I am unable to determine how my custom option is being recognized.
Below is my require grunt task:
requirejs: {
options: {
baseUrl: ".",
appDir: "js",
waitSeconds: 40,
findNestedDependencies: true,
mainConfigFile: "js/common.js",
dir: "../assets/js",
paths: {
"rs": "mains/recordsearch"
},
optimize: "none",
modules: [{
name: "common"
}, {
name: "rs/home"
}, {
name: "commons/html5shim"
}]
},
dev: {},
prod: {
options: {
optimize: "uglify"
}
}
},
and my "main" require js page:
requirejs.config({
paths: {
"jquery": "libs/jquery",
"jquery-ui": "libs/jquery-ui",
"modernizr": "libs/modernizr.custom",
// Other libraries and plugins listed here
},
shim: {
// Dependencies for non AMD compliant files
// Shim configurations here
},
});
require([
// Module dependencies listed here
], function () {
$(function () {
var startModule = $("body").attr("data-jspage");
var siteArea = $("body").attr("data-area");
if (startModule) {
require([startModule]);
}
if (siteArea === "FE") {
require(["commons/signin"]);
}
});
});
Any insights or assistance would be greatly appreciated. Thank you.