Thursday, February 25, 2010

Disable packing of sproutcore javascripts

If you need to debug sproutcore javascripts & want them to load as individual files instead of a single packed "javascript.js" file, add the following to your Buildfile:


mode :debug do
  %w[sproutcore sproutcore/runtime sproutcore/datastore sproutcore/foundation sproutcore/desktop].each do |target|
    config target, :combine_javascript => false
  end
end


This will load the javascripts unpacked when running sc-server (which defaults to "debug" mode), but will get packed when using sc-build (which defaults to "production" mode)