How to use Bundling in Orhcard CMS Theme

Topics: Customizing Orchard, General
Aug 18, 2014 at 4:43 PM
Is there some sample theme or module with System.Web.Optimization?

I have faced with following problems:
  1. System.Web.Optimization need to be delivered with theme, I have placed it to /Dependencies folder of my Theme, but still get The type or namespace name 'Optimization' does not exist in the namespace 'System.Web'. Only reference in Orchard.Web to System.Web.Optimization allows to solve this problem.
  2. ~/bundles/* returns 404, how to register bundle in Orchard CMS?
Aug 18, 2014 at 4:57 PM
Have you tried the module Combinator on the gallery which will do bundling for you automatically ?
Aug 18, 2014 at 5:46 PM
Yes, I tried. But Combinator is fat, there are two modules, Iron.Ruby and code what was not updated last year. My strategy to use minimum modules to avoid problem with upgrade to next Orchard version.
So It will be nice to use just one dll System.Web.Optimization to compress few css and js files. Is it possible to use Asp.Net MVC Bundling in Orchard? And how to do this?
Aug 18, 2014 at 10:44 PM
Combinator is fat? You're fat! :-D

Seriously, why do you care about a feature being there in the module that you can opt not to turn on? Also, Combinator's code was updated three weeks ago, works with the latest Orchard version and is continuously maintained.

"Try to get a better understanding of things before you make your judgement."
Aug 19, 2014 at 7:10 AM
My question is not about Combinator, it is about System.Web.Optimization Bundling.
Oct 3, 2016 at 2:27 AM
Edited Oct 3, 2016 at 5:46 AM
Have the same problem. But in my case i need to generate js. I want to compile some html files (it contains html template for angular controls) into js string and add every template (as string) to $templateCache. So i have my own implementation of TemplatesTransform. And i want to get my bundle by virtual path. Everything is work (bundle create, register and so on), but when browser requests bundle by my (correct) virtual path i have 404 error. What should i do to solve the problem?

Thank for any idea.