bundling-and-minification

MVC4 Bundling Cache Headers

痞子三分冷 提交于 2019-12-18 11:04:40
问题 I want to change the cache headers sent from a bundle request. Currently it is varying by User-Agent but I don't want it to, is there a way to change the headers sent by a bundle request? After a quick look in the System.Web.Optimization assembly I can see the headers get set in Bundle.SetHeaders which is a private static function so I don't think its possible although I would love to be proven wrong. 回答1: This isn't something that we currently expose today. We only expose the Cacheability

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

泪湿孤枕 提交于 2019-12-18 10:48:13
问题 HTML5 has an async attribute for script files, to enable async loading. <script type="text/javascript" src="myScript.js" async></script> I can take advantage of this with my MVC4 bundling by referencing the bundle like so. <script type="text/javascript" src='@Scripts.Url("~/bundles/jquery")' async></script> But what this does mean is my scripts are bundled even when in debug mode. So how can I take advantage of bundling and the async attribute without loosing non-minification when in debug.

How to make bundles unminify and list individual files when using a cookieless static content server?

孤者浪人 提交于 2019-12-18 09:00:26
问题 I have two VS projects, one for the main website and one for a "static content" website where all the css, js, images, and other static content will be stored and accessed via a cookieless domain. So I have a BundleConfig.cs in my static site that creates all the bundles: public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new StyleBundle("~/bundles/styles").IncludeDirectory("~/app/styles", "*.css", true)); bundles.Add(new ScriptBundle("~

ASP.NET / MVC 4 bundling and minification 404 issues on 64-bit IIS 7.5 server

与世无争的帅哥 提交于 2019-12-18 07:46:13
问题 We recently upgraded our project from MVC 3 to MVC 4. We are targeting the .NET 4.0 framework, and our web app is 32-bit due to some references we have to include. The problem we are having is that we converted our bundling / minification from Chirpy to the built-in ASP.NET bundling. The site runs with no problems on 32-bit servers, both Windows Server 2003/IIS 6 and 2008/IIS 7.5 running ONLY .NET 4.0, and our 64-bit development machines. The bundling / minification works fine on all of the

What is the benefit of ASP.NET bundling and minification in runtime?

六眼飞鱼酱① 提交于 2019-12-18 01:05:50
问题 I understand how to use asp.net's new bundling and minification features. They are helpful during development. Is there any benefit to using them in a production deployment though? Would the system perform better if you just placed the bundled/minified files on the web server? It seems that overall, less code would run if they were just static files. Note: I understand the benefit of having js/css bundled and minified. I am only questioning the value of using an active runtime process to

404 errors on bundled jquery css, VS2012 publishing to Azure

China☆狼群 提交于 2019-12-17 19:48:33
问题 I have a web site that uses the jquery datepicker thing (implemented in regular VS2012 MVC4 template). It looks and works fine when running on localhost. But when I publish (to Azure), some of the css is missing. The Chrome dev tools show 404 errors on two css files: http://cyclelog.azurewebsites.net/Content/jquery.ui.base.css http://cyclelog.azurewebsites.net/Content/jquery.ui.theme.css I noticed that there are no such files in my source tree--rather the two files are under ~/Content/themes

Exclude module from webpack minification

穿精又带淫゛_ 提交于 2019-12-17 18:17:24
问题 We are using WebPack in a single page application. The application is deployed to many environments. We have a requirement where the application needs to call a specific endpoint in a given environment. In order to provide the endpoint address for the given environment is to have an environments module. This is the current solution (there are many and this is not the point of the question). However we need to exclude the config.js from minification so that it can be overwritten as part of the

How to upload bundled and minified files to Windows Azure CDN

我的梦境 提交于 2019-12-17 17:33:32
问题 I'm using the ASP.NET MVC 4 bundling and minifying features in the Microsoft.AspNet.Web.Optimization namespace (e.g. @Styles.Render("~/content/static/css") ). I'd like to use it in combination with a Windows Azure CDN. I looked into writing a custom BundleTransform but the content is not optimized there yet. I also looked into parsing and uploading the optimized stream on runtime but that feels like a hack to me and I don't really like it: @StylesCdn.Render(Url.AbsoluteContent( Styles.Url("~

CssRewriteUrlTransform with or without virtual directory

旧城冷巷雨未停 提交于 2019-12-17 06:28:22
问题 We are using MVC Bundling in our site, CssRewriteUrlTransform makes sure that the image urls work from the dynamic bundle css file. But this only works when not using a virtual directory, i.e http://localhost/VirttualDir does not work but http://localhost/ does. This is because the CssRewriteUrlTransform tranform does not take the virtual folder into account when rewriting the url. So if a image real path is localhost/vdir/content/img/foo.png it will rewrite it to localhost/content/img/foo

Is using an ES6 import to load specific names faster than importing a namespace?

故事扮演 提交于 2019-12-17 05:12:35
问题 I've found at least two ways to import functions in from a module like Ramda for example. There are probably a few more ways to do something very similar like const R = require('ramda'); Option 1 is to import certain functions: import { cond, T, always, curry, compose } from 'ramda'; Option 2 is to import the whole module like: import * as R from "ramda"; I would prefer to reference the module from which the function is being called like so: R.T(); But if the 2nd option is used, does it bring