0

In asp.net MVC, included a built-in integrated javascript bundle with BundleCollection. With it, you simply define which resources to add to bundle and render it on the view.

Now I want to make something like javascript/css portal which handle the resources and expose it via webapi.

Is there any stand-alone built-in way to bundle and minify, and return it as string?

Fendy
  • 4,565
  • 1
  • 20
  • 25

1 Answers1

0

I would bundle and minify shared resources at build time.

I have referenced virtual folders in mvc bundles for multiple applications before and it is possible, but I found it a bit clunky.

There is a build time solution here - basically have a post-build event running yuicompressor etc: Concatenate and minify JavaScript on the fly OR at build time - ASP.NET MVC

There are also some runtime solutions there with the creation of a HTTPHandler, etc

Community
  • 1
  • 1
Kaido
  • 3,383
  • 24
  • 34
  • I have seen the answer in you link but it doesn't answer my question. The runtime solution works in asp.net webform not in mvc. Furthermore, I am thinking in managing library version which will require runtime bundling not build time bundling. – Fendy Mar 03 '15 at 10:06