Async loading of javascript files using MVC4 Bundling and HTML5 async attribute

If you upgrade to the 1.1-alpha1 release, you can just add the async attribute to the tag format either via: Scripts.DefaultTagFormat = @”<script src=””{0}”” async></script>” or passing it where you want the async tag Use following instead of Scripts.Render(“~/bundles/jquery”) Scripts.RenderFormat(@”<script src=””{0}”” async></script>”, “~/bundles/jquery”)

Minification failed. Returning unminified contents

I resolved the problem bundling bootstrap.css by doing 2 things: Include the bootstrap.css first in the bundle. The code sample in the question already does this, but I was not. Add the official minified version (bootstrap.min.css) to the project in the same directory as the unminified version. This prompts the bundler to use the existing … Read more

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

The bundling optimization was introduced as a “best practice” when using HTTP/1.1 because browsers could only open a limited number of connections to a particular domain. A typical web page has 30+ resources to download in order to be rendered. With HTTP/1.1, a browser opens 6 connections to the server, request 6 resources in parallel, … Read more

Make ASP.NET bundling specify media=screen for CSS bundle

I’ve found a more elegant solution. I’m using the Styles.RenderFormat(format, bundle). I have a BundlesFormats class with a property called PRINT and I use it like so: public class BundlesFormats { public const string PRINT = @”<link href=””{0}”” rel=””stylesheet”” type=””text/css”” media=””print”” />”; } And in the cshtml: @Styles.RenderFormat(BundlesFormats.PRINT, “~/bundles/Content/print”)

MVC Bundling and CSS relative URLs

CssRewriteUrlTransform updates the CSS Url with absolute path, saying so if we use – bundles.Add(new StyleBundle(“~/Content/css”).Include(“~/Content/site.css”,new CssRewriteUrlTransform())); and we have following CSS class in “site.css” .Sandy { background-image: url(“Images/Sandy.jpg”); border: 1px solid #c8c8c8; border-radius:4px 4px 4px 4px; box-shadow: 1px 1px 8px gray; background-position:left; background-size:contain; -moz-background-size:contain; -webkit-background-size:contain; -o-background-size:contain; background-repeat:no-repeat; min-height:100px; min-width:100px; display:block; } and following folder … Read more

gulp minify all css files to a single file

Your gulp task is missing the concat pipe. gulp.src(‘src/css/**/*.css’) .pipe(minifyCSS()) .pipe(autoprefixer(‘last 2 version’, ‘safari 5’, ‘ie 8’, ‘ie 9’)) .pipe(concat(‘style.min.css’)) .pipe(gulp.dest(‘dist/css’)) Here is a very good tutorial about building with gulp: http://www.smashingmagazine.com/2014/06/11/building-with-gulp/

CssRewriteUrlTransform with or without virtual directory

I am not sure to fully understand your problem, but seeing http://localhost here seems wrong. You should never use an absolute URL for your bundles. For me CssRewriteUrlTransform works perfectly, here is how I use it: bundles.Add(new StyleBundle(“~/bundles/css”).Include( “~/Content/css/*.css”, new CssRewriteUrlTransform())); “Bundles” is virtual. Does this helps? Update I was confused with the “VirtualDir” thing, … Read more

ASP.NET Bundling – Bundle not updating after included file has changed (returns 304 not modified)

I just had the exact same problem. I have a folder with 2 CSS files: ~/Content/main.css ~/Content/main.min.css (pre-existing from my previous manual minification process) My bundling code is this: bundles.Add(new StyleBundle(“~/css/main”).Include(“~/content/main.css”)); No matter how much I changed my main.css the output was the same url with the same contents: <link href=”https://stackoverflow.com/css/main?v=6Xf_QaUMSlzHbXralZP7Msq1EiLTd7g1vId6Vcy8NJM1″ rel=”stylesheet”/> The only way … Read more

How to force BundleCollection to flush cached script bundles in MVC4

We hear your pain on documentation, unfortunately this feature is still changing quite fast, and generating documentation has some lag, and can be outdated almost immediately. Rick’s blog post is up to date, and I’ve tried to answer questions here as well to spread current info in the meantime. We are currently in the process … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)