Is there a way to make MVC4's bundling system include scripts/styles only in debug mode?
For example, I have lots of debug mode scripts which help me debug my system. I obviously don't want them rendered when the system is in release mode.
I thought of using a block like:
bundles.Add(
new ScriptBundle("mybundle")
.Include(
"~/scripts/foo.js",
"~/scripts/bar.js"
#if DEBUG
,"~/scripts/baz-debug.js"
#endif
)
);
but debug mode should be controlled via web.config
.
So what is the correct approach?