How to fix problems with asp.net mvc 4 javascript bundling How to fix problems with asp.net mvc 4 javascript bundling

How to fix problems with asp.net mvc 4 javascript bundling

The Problem

You are using the new JavaScript bundling and minification features in asp.net mvc 4, and some of your JavaScript files are not being included

The Cause

The minification process – in it’s strange wisdom, does not include .min files when it bundles.  Therefore something like

.Include(“~/Scripts/jHtmlArea-0.7.0.min.js”)

will not be included, leading to JavaScript errors.

The Solution

Just use the non-minified version of the script file –

.Include(“~/Scripts/jHtmlArea-0.7.0.js”)

will work just fine – it seems that the asp.net mvc bundler prefers to do it’s own minification.

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.