Browse Source
To use local AMD modules within extra.d plugins, the relative URL for the global requireJS configuration makes this a bit difficult. To solve this the following code can be added to plugin files, before the first define call. ``` require.config({ paths: { 'extra.d': '../../../extra.d', } }) define(['./local-module'], function(localModule) { /* ... */ }); ``` This change adds this configuration by default, so it is no longer required to have it in each plugin which want to use './local-module' syntax in require or define. As all plugins loaded via `extra.d` folder are inside `extra.d` this automatically means that the URLs are resolved correctly from the extra.d base URL as defined by the plugin itself.pull/325/head
1 changed files with 3 additions and 1 deletions
Loading…
Reference in new issue