FAQ Database Discussion Community


is it possible to include Scripts and Styles in same Bundle ?(asp.net mvc5)

asp.net-mvc,asp.net-mvc-5,bundling-and-minification,scriptbundle,stylebundle
Attempting to use css and js files with same virtualpath bundle name 1 - is it possible ? (tried:but failed. cant define same virtual path name both for script and style) 2 - it it possible to builtup a ScriptAndStyleBundle together included with a mixed bundle ? Just because I...

Automatically switching to minified CSS & JS files in different environments

asp.net-mvc,asp.net-mvc-5,bundling-and-minification,web-essentials
I am using ASP.Net MVC 5 and also taking advantage of WebEssentials LESS and bundle features. WebEssentials is setup to create minified css and js files on save. This is a feature I want because I can monitor the output and it lowers the application startup time (not using Asp.Net...

Why bundle optimizations are no longer a concern in HTTP/2

bundling-and-minification,http2
I read in bundling parts of systemjs documentation that bundling optimizations no longer needed in HTTP/2: Over HTTP/2 this approach may be preferable as it allows files to be individually cached in the browser meaning bundle optimizations are no longer a concern. My questions: It means we don't need to...

BundleTable.Bundles.GetBundleFor() returns but not Items inside

asp.net,asp.net-mvc,bundling-and-minification
Briefly: Bundles which contain items from a VirtualPath (Served by custom VirtualPathProvider) don't work. Hash isn't generated in the v= and resolving them shows the .Items property as empty. Detailed: Suppose we have a bundle registration: bundles.Clear(); bundles.ResetAll(); BundleTable.EnableOptimizations = true; bundles.Add(new StyleBundle("~/bundles/css") .Include("~/Content/site.css")); bundles.Add(new StyleBundle("~/bundles/admin/somestyle") .Include("~/Areas/Admin/Content/css/aaa2.css")); Some notes here:...

Load resources via CDN or minifiy/concat and serve yourself? [on hold]

javascript,css,minify,bundling-and-minification
When serving static css/js/etc resources one has the option to use a cdn or to use your own server. With a CDN you include many includes but they can already be minified. Alternatively you may minify and concatenate all the files into one css bundle and one js bundle. Which...

Ignoring files in MVC Bundles

c#,asp.net-mvc,bundling-and-minification
We are using feature flags (set in Web.Config) to toggle the visibility in the UI of certain features that aren't yet complete. I'd also like my MVC bundles to NOT include the related JS files since they would just be useless files the client would have to download when the...

Does the ASP.net bundler automatically minify files?

c#,asp.net-mvc,bundle,bundling-and-minification
I'm using ASP.net MVC 4. Like the question states, if I put a bunch of JS files (or CSS, for that matter) into a bundle, will it automatically be minified? For example, should my bundle read: bundles.Add(new ScriptBundle("~/bundles/exampleBundle").Include( "~/Scripts/jquery-masked.js" "~/Scripts/jquery.idletimer.js" )); Or should it instead include the minified files initially:...

Defining CDN path for multiple files included in a bundle

c#,asp.net,bundle,bundling-and-minification
This is my first time that I want to use bundling and minification. And I found examples and explanations for almost everything but using a cdn path for a bunch of files included in a bundle. all examples that uses a cdn were like: var styleSheet = new StyleBundle("~/JQMstyle", "http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css").Include("~/theme/jquery.mobile.structure-1.3.1.css");...

Why would both regular and minified Bootstrap CSS be referenced in code?

html,css,twitter-bootstrap,minify,bundling-and-minification
I am trying to implement a third-party script which references the following in its demo template: <link href="/css/bootstrap-image-gallery.min.css" rel="stylesheet"> <link href="/css/bootstrap-responsive.min.css" rel="stylesheet"> <link href="/css/bootstrap.css" rel="stylesheet"> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/jquery.fileupload-ui.min.css" rel="stylesheet"> <link href="/css/prettify.css" rel="stylesheet"> <script type="text/javascript"...

Webpack: Is it possible to evaluate javascript expression at compile time?

javascript,node.js,bundling-and-minification,webpack
I'm trying to setup webpack for my project. The project is big enough and is provided in multiple languages. I want each of my entry points to be provided in each language as separate files. My language files are not just plain JSON, but JavaScript instead. So i18n plugin doesn't...

Single bundle file vs Multiple files?

bundling-and-minification
Recently I've made changes to an application which had 20 different .js files being referenced, to using bundling to bring this down to one file. This includes: Frameworks (jQuery library) Custom logic (global logic for header navigation etc) However after deployment this showed that we we're no longer making use...

Problems with style of Jquery Datatable at publishing (possibly bundling issue)

asp.net-mvc,css3,datatables,jquery-datatables,bundling-and-minification
I have been running into some bizarre issues when I try to publish my ASP.net MVC web app to my test servers IIS. I have decided that this might have something to do with the bundling. In my application I use a jquery datatable to display real-time data from a...

How can I use gulp to concatenate bower_components that contain assets?

gulp,bower,bundling-and-minification
I'm developing a sample application which uses bower for it's dependency management and gulp for it's build system. I've used the main-bower-files plugin to copy all of the relevant files from the bower_components directory into a build/dist/bower_components directory. This all works perfectly, and I can open my application's index.html which...

Load minified files generated by WebEssentials with RequireJS

javascript,requirejs,typescript,bundling-and-minification
I used WebEssential tool to generate some minified version typescript files, so right now i have all the .min.js files. Now I want to use that minified files version on the project, but they was never loaded. I use to import modules like this: import Controller1 = require('ctls/Controller1'); but it...

Bundling files in different directories?

c#,css,asp.net-mvc,bundle,bundling-and-minification
I recently came across an issue on a website where the styling on a page was really messed up but only in IE. My boss told me it is likely to be because the CSS Bundle being rendered contains CSS files from different directories, so I checked and it did....

Bundling and Minification in MVC 6

bundling-and-minification,asp.net-5,asp.net-mvc-6
It looks like Bundling and Minification are no longer built into MVC 6 since there is no more App_Start and Bundle.Config. Is this going to be the case after final release? I'm guessing Grunt should be used since that seems to be baked into Visual Studio 2015. UPDATE: It looks...

Prevent circumventing ASP.NET minification

javascript,asp.net,asp.net-mvc,minify,bundling-and-minification
I've got some ASP.NET that I'm deploying as an Azure cloud service. The javascript files have comments in them that I'd like not to be visible to anyone consuming the JS. I'm taking advantage of ASP.NET bundling and minification: http://www.asp.net/mvc/overview/performance/bundling-and-minification This seems to be a nice solution in that it...

AngularJS minification

angularjs,gruntjs,bundling-and-minification
EDIT 3 : The problem was absolutely not dependencie injection but with angular-mock. See 'Pierre Gayvallet' answer below. I'd like to avoid using ngmin, ngAnnotate or others grunt plugin when i minify my code. So i'm using inline annotation like this : app.controller('myController', ['$scope', function($scope) { // some code }]);...

Asp.Net bundling not using the .min files

c#,asp.net,asp.net-mvc,bundling-and-minification
According to documentation in release mode the bundler should use the .min.js file if it exists. I am adding angular the following way: bundles.Add(new ScriptBundle(Bundles.Scripts).Include( "~/Content/Scripts/angular.js")); I have angular.js and angular.min.js in the same folder. So according to what I understand the bundler should just use the angular.min.js and do...

Closure compiler export Typescript classes and functions

javascript,typescript,minify,google-closure-compiler,bundling-and-minification
I am trying to use closure compiler advanced mode on typescript generated classes with no success. Is there anyone who has accomplished such things. Typescript Class class TestData { BlogName: string; CacheTimeOut: number; CopyrightHolder: string; constructor(blogName: string, cacheTimeOut: number, copyrightHolder: string) { this.BlogName = blogName; this.CacheTimeOut = cacheTimeOut; this.CopyrightHolder =...