I'm trying to integrate Rejuice (github page is here) to my asp.net mvc project to combine js files. I downloaded it via nuget. It successfully added references and configured web.config file.
In global asax Application_Start I configured it as below:
OnRequest.ForJs("~/Combined.js")
.Combine
.FilesIn("~/Scripts/").Matching("*.js")
.Configure();
OnRequest.ForJs("~/Combined.css")
.Combine
.FilesIn("~/Style/").Matching("*.css")
.Configure();
In master page:
<%= Rejuiced.JsFor("~/Combined.js") %>
<%= Rejuiced.CssFor("~/Combined.css")%>
Running project in release mode results in downloading all the js and css files seperately. Running the site under IIS didn't help either. Isn't it supposed to combine and download only 2 files, one for js and another for css? What can cause this problem
Make sure that debug="true" is removed from your your web.config file:
Change
<system.web>
<compilation debug="true" targetFramework="4.0">
to
<system.web>
<compilation debug="false" targetFramework="4.0">
It doesn't matter if you build your code in Debug or Release -- Rejuicer respects the web.config debug setting, as it should. If this is set to true, then Rejuicer will not minify and combine files. It does this so that you can debug your scripts using non-minified files when working locally.
When you push your code into Production, your web.config.release transform will run, and remove the debug="true" attribute from your web.config file, so that your files will always be minified in production scenarios.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With