Browse Source

Add require relative load support

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
Simon Eisenmann 9 years ago
parent
commit
98ae511ae8
  1. 4
      static/js/main.js

4
static/js/main.js

@ -56,7 +56,9 @@ require.config({ @@ -56,7 +56,9 @@ require.config({
'partials': '../partials',
'sounds': '../sounds',
'translation': '../translation'
'translation': '../translation',
'extra.d': '../../../extra.d'
},
shim: {
'modernizr': {

Loading…
Cancel
Save