The AMD require function supports an error callback as its optional 3rd parameter, which can be used to implement the first bullet point.
The basic idea behind the implementation of the second and third, is that a loader plugin is woven inbetween and used to pull up a require function local to parentName, which in turn is used to resolve moduleName. This will support relative module name lookup. The query-string slug used in the gist should, iirc, be ignored by the module-local remapping feature, making it work as if this was the require local to the original parentName module. However, I am not 100% sure.
Expected behavior:
<can-import>
.require.config({ map : ... })
are honored.Actual current behavior:
require.config({ map : ... })
are not honored.Proposed solution: See the following gist: https://gist.github.com/rjgotten/7e1ecc8aa6e909add99f772e70d238cb
The AMD
require
function supports an error callback as its optional 3rd parameter, which can be used to implement the first bullet point.The basic idea behind the implementation of the second and third, is that a loader plugin is woven inbetween and used to pull up a
require
function local toparentName
, which in turn is used to resolvemoduleName
. This will support relative module name lookup. The query-string slug used in the gist should, iirc, be ignored by the module-local remapping feature, making it work as if this was therequire
local to the originalparentName
module. However, I am not 100% sure.