4

Is it possible to use ASP.NET Web Optimization for minification without bundling?

Lets say I have a page Example.cshtml and corresponding javaScript file for that page Example.js. I would like to be able to do something like @Scripts.Render("~/Scripts/Views/Example.js") which will product minified file when not in debug mode. I could of course maintain many single JavaScript file bundles to do this but it seams like unnecessary chore.

Of course there are other solutions for javaScript compression but I think that single approach with run-time compression is the best way to go.

Vukoje
  • 500
  • 4
  • 9

1 Answers1

1

You would have to create a bundle with just one file to accomplish this currently.

Hao Kung
  • 28,040
  • 6
  • 84
  • 93
  • tnx Hao, I have been trying to reach you unsuccessfully :) Will you be adding this or is my wish seams unreasonable? I could also accomplish this by creating bundles at run-time by using some naming convention but built in feature sounds better. – Vukoje Mar 04 '13 at 11:58
  • 1
    We've gotten this request in the past several times, this feature fits nicely into the asset management work, so it most likely won't happen until we get to that feature. – Hao Kung Mar 04 '13 at 15:38