Talk:Modules/LoaderPlugin

From CommonJS Spec Wiki
Jump to: navigation, search

Clarifications

The section about require.toUrl says that the method takes a parameter, resource-name. Is resource-name a module Id as defined at the top? Specifically, does it include the loader-plugin-module-id and "!" parts of Module Id?

This section also says "The toUrl function shall use the same resolution mechanism as the require() function it is attached to, except that no file extension should be added." Added by which? By the user (as input to the function) or by the toUrl function (as the return value).

The description of the load() method says "The second argument is the require() (or equivalent) function that was or would be provided to the calling module, that is the module is requesting the resource or module using a module id with the loader plugin form." I find this very confusing. Can you provide more details about what the second argument looks like?