hearsayit / HearsayRequireJSBundle

RequireJS integration for Symfony2.
130 stars 55 forks source link

Support RequireJS 2.0 insertRequire #9

Closed AsaAyers closed 11 years ago

AsaAyers commented 12 years ago

The new version of RequireJS doesn't evaluate modules until they're require()'d [1]. With the way this bundle generates a hash for the module name it breaks when you use RequireJS 2.0.

I'm using data-main to point to my module's name which works in dev, but when I optimize for production the name is changed from "time/main" to "1441772dab8a4acdfab0c5314acc2fdc". Without the code in the commit the optimized file never executes the main module.

[1] https://github.com/jrburke/requirejs/wiki/Upgrading-to-RequireJS-2.0#wiki-delayed

ihortymoshenko commented 11 years ago

@AsaAyers, thanks for the contribution and sorry for the so long response. I added the prososal changes in the https://github.com/hearsayit/HearsayRequireJSBundle/commit/7b7ef864f4b704b1ce38df141213a5d2195d0fad commit. Let me know if something wouldn't work for you. Cheers!