Publishes a RequireJS module

Usage

This extension point can be used to publish a RequireJS module to the global RequireJS configuration, allowing others to use the module without specifying its path.

Definition

This Extension Point is contributed by this extension and was added in version 12.3RC1 of that extension.

Category
JavaScript
Extension Id
org.xwiki.platform.requirejs.module
Content to be provided
No content is expected to be provided by the user of this Extension Point.
Parameters to be provided
  • id: the RequireJS module id
  • path: maps to require.config.paths
  • bundles: optional, maps to require.config.bundles
  • deps: optional, maps to require.config.shim.deps
  • exports: optional, maps to require.config.shim.deps
  • config: optional, maps to require.config.config

Example

For instance, using this extension point with the following parameters:

id=xwiki-suggestAttachments
path=$xwiki.getSkinFile('uicomponents/suggest/suggestAttachments.js', true)

allows others to write:

require(['xwiki-suggestAttachments'], function(...) {
  // ...
});

anywhere in XWiki.

Tags:
Created by Marius Dumitru Florea on 2020/04/29
   

Get Connected