Last active
December 16, 2015 01:39
Custom Dojo Loader Plugin for loading ESRI modules that you want the build system to ignore.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
// summary: | |
// A dojo loader plugin for loading esri modules so that | |
// they get ignored by the build system. | |
return { | |
load: function (id, require, callback) { | |
// id: String | |
// esri module id | |
// require: Function | |
// AMD require; usually a context-sensitive require bound to the module making the plugin request | |
// callback: Function | |
// Callback function which will be called, when the loading finished. | |
require([id], function (mod) { | |
callback(mod); | |
}); | |
} | |
}; | |
}); |
so this is working? the build doesn't try to flatten the dependency?
I thought the usage was more like
define(['app/EsriLoader!esri/map'], function(Map) { /* ... */ });
Since it's using require
to load the module, it seems like it'd need to be a slash, not a period.
You're right @brianarn. I need to get out of the "." habit from the old dojo.require days.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You use it like this: