miracle2k/webassets — pull request #228 by afavaro (2013-03-27 02:22:38+00:00)
Title: First pass at 'spew' debug mode

I took a shot at implementing a `spew` debug mode similar to what was mentioned in #168. I've added a `spew_output` attribute for top-level bundles that specifies the directory into which files should be saved after applying filters. Files are saved in this directory using the same directory structure relative to the environment directory. External assets (loaded from URLs) are saved in `host.com/path/to/file.js` in this directory. There's also an optional `spew_ext` attribute that lets you specify a new extension for generated files.

This is just a rough draft so I haven't tested anything extensively but if this looks like something you might want I can write some tests and documentation. A few remarks:
* This implementation assumes that all input files paths are relative to the environment directory so it won't work with absolute file paths
* Version placeholders are ignored but I don't think we need those for this mode
* Because this doesn't do anything with versions it also doesn't touch the manifest. Again I don't think we need to for this mode

Let me know what you think. I'm happy to make changes if you'd rather do this differently. Would love to see this feature in webassets and possibly add support for source maps as well.