As I understand it, require.js' paths config lets you create local aliases and prefixes for local dependencies.
However, the requirejs_include_tag helper only makes the paths config available in the rendered javascript, if that path is an absolute URL (or an array of fallback URLs)
If I want my modules to depend on jQuery and have that linked to this correctly versioned file, I'd expect to be able to use config like this:
paths:
jquery: 'jquery-1.12.0'
…but (as described above) this config never makes it to the browser. What am I doing wrong?
I should note that, if I remove the if condition from the line I linked above then I do see the config rendered and everything works properly, but I guess there must be some other reason for that condition to be there, I just don't know what it is.
As I understand it,
require.js
'paths
config lets you create local aliases and prefixes for local dependencies.However, the
requirejs_include_tag
helper only makes the paths config available in the rendered javascript, if that path is an absolute URL (or an array of fallback URLs)If I want my modules to depend on jQuery and have that linked to this correctly versioned file, I'd expect to be able to use config like this:
…but (as described above) this config never makes it to the browser. What am I doing wrong?
I should note that, if I remove the
if
condition from the line I linked above then I do see the config rendered and everything works properly, but I guess there must be some other reason for that condition to be there, I just don't know what it is.