ORO CRM has a piece of code that returns a requires.js config
requirejs.config.js.twig:
paths: {
{% if app.debug %}
'oro/routes': '{{ path('fos_js_routing_js', {"callback":
"fos.Router.setData"}) }}'
{% else %}
'oro/routes': {{ asset('js/routes.js',
'routing')|json_encode|raw }}
{% endif %}
}
in dev mode (debug on), this gets rendered as
paths: { 'oro/routes': '\x2Fapp_dev.php\x2Fjs\x2Frouting\x3Fcallback\x3Dfos.Router.setData' }
... and this works. with the debug mode, however, this will rendered as:
paths: {
'oro/routes': "\/js\/routes.js"
}
which, with require.js adding another ".js" extension, the browser then tries to retrieve
/js/routes.js.js
(why the backslashes?)
this doesn't work ... so why does this happen? is that a config problem somewhere? or am i too stupid?
regards
.rm