jupiterjs/steal — pull request #69 by asavoy (2012-02-23 16:41:59+00:00)
Title: Multi-build fixes and css packaging

These are a set of fixes for getting multi-build back to a usable state. They are rather crude and hacky, so I guess it's at least a good starting point for further refinement. I've given it a bunch of testing, and now am putting it forth for review.

### Changes

* fixed 'Cannot read property "js" from undefined' when trying to run multi-build
* added support for CSS packaging
* packages get an embedded CSS package loader
* fixed modules embedded in packages were being executed before their dependencies loaded. also ensure they don't try to load dependencies that are already in pending packages.
* fixed IE8/9 error when trying to load a packaged app

### Testing

Initially I worked with a project built as follows:

./js jquery/generate/app testapp/plugin1
# add & steal testapp/plugin1/plugin1.css
./js jquery/generate/app testapp/plugin2
# add & steal testapp/plugin2/plugin2.css
# steal testapp/plugin1
./js jquery/generate/app testapp/app1
# add & steal testapp/app2.css
# steal testapp/plugin2
./js jquery/generate/app testapp/app2
# add & steal testapp/app2/app2.css
# steal testapp/plugin2

# build:
./js steal/buildjs testapp/app1 testapp/app2

Then I tested with the app I'm working on, which is much larger (30 apps). I've tested it on the latest of Chrome, Safari, Firefox, IE8, IE9.

I added a fix later when I found an intermittent issue based on which package downloaded first - this is easy to replicate if you reverse the load order of the packages in production.js.

### Notes

* Need to rebuild steal.production.js, but I don't know how. This means to test, you need to use steal.js but force it to use production mode.
* It seems you need to wrap all third-party JS files with the right dependencies: `steal('jquery', function() { ... })` or they will potentially run out of order.
* It's not yet doing CSS compression.
* Not tested types other than JS and CSS files.