0

So I am playing around with ASP.NET MVC 5 in Visual Studio 2017 and was curious on the Bundle Config relationship. I was reading that it was better for gathering multiple files for efficiency. Yet it appears to not like a callout to the minified file for later references. EG:

This:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                  "~/Scripts/jquery-{version}.js"));

...

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                "~/Scripts/bootstrap.js",
                "~/Scripts/respond.js"));

is fine and works fine.

This:

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
              "~/Scripts/jquery-{version}.min.js"));

...

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
            "~/Scripts/bootstrap.js",
            "~/Scripts/respond.js"));

does not. It appears that any form of

"~/Scripts/jquery-{version}.min.js"))"

or

"~/Scripts/jquery-1.10.2.min.js"))"

will screw it up. If I want third party javascript libraries and to bundle them for efficiency I would think I could bundle them minified. Is it an issue with the registration of the Jquery min library to be recognized properly by Bootstrap?

6
  • try to add both file min and normal, and use into the bundle the version without min with the {versione} placeholder Apr 26, 2017 at 15:32
  • @Darion I can get it working with the full version, I was curious on using minification for speed of loading only. It works fine without minification which is the real issue. I want to load minified files for faster loading.
    – djangojazz
    Apr 26, 2017 at 15:39
  • into the web.config -> system.web -> compilation set the attribute debug=false Apr 26, 2017 at 15:40
  • @Darion That is missing in the web config, are you saying to add it?
    – djangojazz
    Apr 26, 2017 at 15:42
  • 1
    yes, the tag should look like this: <compilation debug="false" targetFramework="4.5"> Apr 26, 2017 at 15:44

1 Answer 1

0

You can test the minified version changing the web.confing compilation tag setting the debug attribute to false like this:

<compilation debug="false" targetFramework="4.5">

This is automatically set by Visual Studio to false when you publish the production version. Of course, if you need to test it in the develop enviroment, you can change it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.