Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have some scripts in my directory:

  • jquery-2.1.4.js
  • jquery-2.1.4.min.js
  • jquery-2.1.4.intellisense.js

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"));
like image 342
Martin Dawson Avatar asked Aug 20 '26 11:08

Martin Dawson


1 Answers

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.

like image 198
Philip Smith Avatar answered Aug 23 '26 01:08

Philip Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!