Martin Dawson
Martin Dawson

Reputation: 7656

Asp.net Bundle does {version} include min.js and non-min?

I have some scripts in my directory:

What does the below bundle include? Does it include the jquery-2.1.4.js and jquery-2.1.4.min.js? If so why would we want to do this? Won't it just slow down the website by loading same scripts that are not needed.

bundles.Add(new ScriptBundle("~/bundles/jquery", "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js").Include(
                                "~/Scripts/jquery-{version}.js"));

Upvotes: 3

Views: 1066

Answers (1)

Philip Smith
Philip Smith

Reputation: 2801

The bundle that you have defined will load jquery-2.1.4.js when compiled as debug. However when compiled as release the min version will replace it. In this way you get the un-minified version when debugging, but the minified version in production.

Upvotes: 6

Related Questions