Thanks for your very useful example, Carlos!
On Sat, 09 Apr 2016 15:48:58 -0300, Carlos Montero Canabal
wrote:
In your controller class (.java) you can write this:
javaScriptSupport.addModuleConfigurationCallback(new
ModuleConfigurationCallback() {
@Override
On Sat, 09 Apr 2016 09:05:17 -0300, Ilya Obshadko wrote:
Facebook recommends the following method to integrate FB SDK using AMD
approach:
https://developers.facebook.com/docs/javascript/howto/requirejs/v2.5
However I can't find any obvious way to configure RequireJS paths in
Tapestry.
Is ther
In your controller class (.java) you can write this:
javaScriptSupport.addModuleConfigurationCallback(new
ModuleConfigurationCallback() {
@Override
public JSONObject configure(final JSONObject
configuration) {
Greetings, Ilya.
Here is my example for Yandex maps module. As you can see I define
require.js config in module file.
requirejs.config({ paths: { 'ymaps': '//api-maps.yandex.ru/2.1/?lang=ru-RU',
'geolib': 'map/geolib.min' }, "shim": { 'ymaps': { exports: 'ymaps' },
'geolib' : { exports: 'geolib' }
Pavel,
So you just manually add requirejs.config call in every module file that
has external AMD dependencies?
This is helpful - thanks a lot!
On Sat, Apr 9, 2016 at 3:47 PM, Pavel Chernyak wrote:
> Greetings, Ilya.
> Here is my example for Yandex maps module. As you can see I define
> require.
Greetings, Ilya.
Here is my example for Yandex maps module. As you can see I define
require.js config in module file.
requirejs.config({ paths: { 'ymaps': '//api-maps.yandex.ru/2.1/?lang=ru-RU',
'geolib': 'map/geolib.min' }, "shim": { 'ymaps': { exports: 'ymaps' },
'geolib' : { exports: 'geolib' }
UPD: the obvious workaround is downloading it locally and contributing to
ModuleManager:
@Contribute(ModuleManager.*class*)
*public* *static* *void* contributeModuleConfigiration (
MappedConfiguration configuration,
@Path("context:js/facebook/sdk.js") Resource facebookSdk ) {
Facebook recommends the following method to integrate FB SDK using AMD
approach:
https://developers.facebook.com/docs/javascript/howto/requirejs/v2.5
However I can't find any obvious way to configure RequireJS paths in
Tapestry.
Is there any way to do it?
--
Ilya Obshadko