0

I have built an ASP.NET 4.5 Web Forms Application utilizing the Bootstrap 3.2 Framework.

I have both: bootstrap.js and boostrap.min.js in my project.

Checking the BundleConfig.cs it is not very apparent as to where these 2 are defined. Every other 3rd party script that I'm using is clearly defined there.

Checking the references.js it appears that bootstrap.min.js is referenced there, but not boostrap.js

That being said I would like to find out how I can go about switching from bootstrap.js to the minified version bootstrap.min.js from within Visual Studio.

Paul
  • 974
  • 2
  • 13
  • 37
  • See [bundling and minification](http://www.asp.net/mvc/overview/performance/bundling-and-minification). As for `.config` vs `.cs`, see [this](http://stackoverflow.com/q/13726956/304683). Hth... – EdSF May 24 '15 at 14:43

1 Answers1

1

Checkout the Bundle.config. You can create your own bundles there.

A release build of the application will use the minified versions.

<system.web>
    <compilation debug="false" />
Frank Witte
  • 466
  • 5
  • 17
  • the Bundle.config are for CSS Scripts. The BundleConfig.cs are for JS Scripts as I mentioned. – Paul May 24 '15 at 13:36
  • My bad misread the question. A release build would use the minification. – Frank Witte May 24 '15 at 14:05
  • would I need to then delete boostrap.js from my project? – Paul May 24 '15 at 14:50
  • No it will choose either depending on your build/deployment. – Frank Witte May 24 '15 at 15:56
  • 1
    To expand on this answer a bit: When `debug=false`, all of the CSS files referenced in Bundle.config will be minified into a single CSS file served to the client. If a minified version of the css file already exists (e.g. `bootstrap.css` and `bootstrap.min.css`), it will include the minified version. Otherwise, it will minify the single CSS file (e.g. `myfile.css`.) and include that version. – Benjamin Ray May 25 '15 at 20:08
  • @BenjaminRay would that include BundleConfig.cs minifying .js ? – Paul May 26 '15 at 00:59
  • BundleConfig.cs works differently. See our previous discussion here: http://stackoverflow.com/a/29085866/4669143. When `debug=false`, the script defined in `.Path=""` is used. When `debug=true`, the script defined in `.DebugPath=""` is used. If `.DebugPath` is not defined, it uses the value in `.Path` in both cases. The scripts are not minified or bundled together like the CSS files are, so you would have to add your own minified version in `.Path="myscript.min.js"`. – Benjamin Ray May 26 '15 at 15:25