A secondary issue found with requirejs/r.js#833: when the loader processes define() calls, it enables them and its dependencies. This triggers check() which can then lead to a fetch of the dependencies. However, in a built file, if the dependency is defined, but below the current define()'d module being processed, it can lead to an incorrect fetch instead of just waiting for the deifne() calls to be fully processed.
Example:
// bar.js
define('bar', function(require) {
var foo = require("./foo");
});
define('foo', function () {});
// app.js
define(['bar'], function () {});
Requiring 'app', which will then load 'bar', will lead to fetch for 'foo', when the define()'d 'foo' later in the bar.js file should be used.
A secondary issue found with requirejs/r.js#833: when the loader processes define() calls, it enables them and its dependencies. This triggers check() which can then lead to a fetch of the dependencies. However, in a built file, if the dependency is defined, but below the current define()'d module being processed, it can lead to an incorrect fetch instead of just waiting for the deifne() calls to be fully processed.
Example:
Requiring 'app', which will then load 'bar', will lead to fetch for 'foo', when the define()'d 'foo' later in the bar.js file should be used.