I'm seeing some strange results with steal and can.js (the version packaged with JMVC 3.3)
Previously, I had encountered some problems with getting steal to build things at all, which I posted here:
I am in a Rails environment where we have several different engines, and jmvc is packaged in one of those engines. So, the basic topography looks like this:
/engines/dev_tools/public/js -- where everything jmvc is placed, including steal, stealconfig.js, etc
/engines/my_engine/app/assets/javascripts/page_one.js - this is the primary javascript file that I want to turn into a production.js file
/rails_app - this is the rails app that includes the other two engines
The minified file that is generated by steal gets copied into the /public folder of my rails app when I compile assets for production
When I invoke steal like this, things seem to work okay:
./js steal/buildjs ../../../../my_engine/app/assets/javascripts/page_one.js -to "output"
In the simplest cases, the page_one.js file is minified and built and everything seems fine. That file gets copied into the public folder when I compile assets and is served up by steal.production without any issues. However, if any of the files I steal into the build try to steal old jquerymx or can.js entities:
steal('jquery/class',
'jquery/controller',
'jquery/model',
'jquery/dom/form_params',
'jquery/controller/view',
function(){ ....
then that first file is not included in the packaged file. To make that concrete, say page_one.js steals another file (helper_one.js). That file steals in the components as above. In the packaged/minified file, the contents of page_one.js are no longer included.
Okay, fine so I got around that by adding another file to my build: page_one_loader.js, which looks like this (paths omitted because they don't appear to be relevant):
steal('jquery', 'helper_one.js', page_one.js');
I then invoke steal.build on that file:
./js steal/buildjs ../../../../my_engine/app/assets/javascripts/page_one_loader.js -to "output"
Now, the contents of page_one.js are included in the file and things mostly work just fine. However, when I load the file into the page using steal.production.js, steal goes out and requests page_one_loader.js, but in an odd location:
Clearly I'm still missing something here, but I'm not sure what. I'd like to do away with the *_loader.js file entirely, but if that isn't possible - is there any way to squash that extra resource request? Am I missing some option in stealconfig.js?