hearsayit / HearsayRequireJSBundle

RequireJS integration for Symfony2.
130 stars 55 forks source link

How can I use modules for r.js? #54

Closed jifeon closed 10 years ago

jifeon commented 10 years ago

I have a multi-page project and want organize my scripts following this example. But when I specify "modules" section in the build profile for r.js, optimizer throws an error:

Optimization failed: Error: If the "modules" option is used, then there should be a "dir" option set and "out" should not be used since "out" is only for single file optimization output. at Function.build.createConfig (/home/abalakirev/www40/my-ru/app/Resources/js-vendors/js/RequireJS/r.js:23253:19)

If I set the "dir" option, optimizer says "out" option is incompatible with "modules".

What I'm doing wrong? What the true way for organizing scripts in a multi-page application using your bundle?

apsavin commented 10 years ago

What if I'll just add a condition here?

ihortymoshenko commented 10 years ago

This issue is related to the issue https://github.com/hearsayit/HearsayRequireJSBundle/issues/43. So I think it should be resolved within the confines of the issue https://github.com/hearsayit/HearsayRequireJSBundle/issues/43. If you have any fresh ideas how to do it, feel free to contribute.