Script.Load API that is a view engine specific helper and that directs rendering within the using (using Idisposable pattern) to a buffer that can be rendered later.
When using the shortcut registration+require Script.Require("../script/foo.js") we resolve the url to an app-relative path and use that as the id.
If you want ot define a debug version in that case, just do a proper registration.
To decide if the app is in debug mode, we look at a setting on the require, then at site setting mode and as a last resort on the compilation mode of the app.
Merge asap, then debug, then refactor.
Raw notes from Dave during meeting:
====================================
Script.RequireHead("TinyMce");
Script.RequireFoot("TinyMce", new RequireSettings { DebugMode = false });