Anybody working with Dojo on the asset pipeline?
I disabled the sprocket compression for development mode (<%= javascript_include_tag “application”, debug: Rails.env.development? %>), so its not trying to compress all of the SDK each time. I figured I would just use the Dojo build system prior to deployment instead. So everything seems to work fine though when I use the dojo loading mechanism, it gets weird.
I have the SDK in vendor/assets/javascripts (so the dojo.baseUrl is set there), then in app/assets/javascript I require my custom base file in the manifest //= require mydojofile.
Now my dojofile is in coffeescript and it dojo.requires my starting file (also in coffeesecript) i.e:
<mydojofile.coffee>
dojo.ready(
→
dojo.require “myobj”
)
<myobj.coffee> (also in app/assets/javascript, natrually)
alert “Wooohooo”
So, this actually works! well… somewhat. myobj executes fine, though the console reports an error that dojo couldn’t find myobj.js in the modulePaths…
Now if I register the modulePath to dojoConfig prior to the dojo.js load, it still is looking for the compiled myobj.js which isn’t there until runtime, i guess, right?
I haven’t tried completely turning off the auto compilation of coffeescript and do it manually (so the myobj.js actually exists)… though I don’t know if anybody else has a better solution here… .or maybe just somehow supress those errors (as it is actually working)?