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)?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/LsqSUUr-HIEJ.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.