bundling-and-minification

Script Bundling in WebForms with Virtual Directories

天涯浪子 提交于 2019-12-14 03:57:14
问题 We have a separate "Framework" project for shared controls, javascript, etc. that is used by this and other projects. The Framework project is included in our solution, and we made a virtual directory for it with IIS so we can still make relative links to files with ~/Framework . So, we want to begin using the new Web Optimization bundles for scripts and styles. Everything is working fine, but we are having issues when attempting to use bundling with JS files in the virtual directory. When

CSS Bundling and Internet Explorer's Limit

耗尽温柔 提交于 2019-12-13 16:15:30
问题 When I add jquery ui to the bundle I end up with: bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.resizable.css", "~/Content/themes/base/jquery.ui.selectable.css", "~/Content/themes/base/jquery.ui.accordion.css", "~/Content/themes/base/jquery.ui.autocomplete.css", "~/Content/themes/base/jquery.ui.button.css", "~/Content/themes/base/jquery.ui.dialog.css", "~/Content/themes/base/jquery.ui.slider.css", "~/Content

ASP.NET using embedded resources in Bundling

混江龙づ霸主 提交于 2019-12-13 12:59:02
问题 I'm trying to implement a generic approach for providing the possibility for different assemblies in my web solution to use embedded JavaScript and CSS files from embedded resources. This blog post shows a technique using a VirtualPathProvider. This works fine, but the VirtualPathProvider needs to be included in each assembly containing embedded resources. I tried to enhance the VirtualPathProvider from the blog post, so that an assembly can be passed into it and it loads the resource from

Can the Bundle.config include ScriptBundles?

旧街凉风 提交于 2019-12-12 12:29:48
问题 Can I include scripts in my Bundle.config file, or is it only for style bundles? <?xml version="1.0" encoding="utf-8" ?> <bundles version="1.0"> <styleBundle path="~/Content/css"> ... </styleBundle> <scriptBundle path="~/Scripts"> Is this possible? </scriptBundle> </bundles> Also can anyone provide a link to a Bundle.config reference that explains the possible tags and structure? I've searched but all I can come up with is the BundleConfig.cs code way of bundling rather than the markup. I

Intellisense with MVC4 Style Bundling

谁都会走 提交于 2019-12-12 10:31:43
问题 So far I can't find a question or fix for this. I'm sure it's something simple I'm missing. I have a style bundle with a bunch of minified CSS, and I am decorating HTML elements with the classes inside. Everything is working great. Intellisense and ReSharper however are both bugging me about the CSS the classes being unknown. I'm guessing this is because they cannot peek inside the bundles. Question: Is there a way to fix this? <!-- Style Bundles in HEAD tag--> @Styles.Render("~/bundle/style

ScriptBundle adding both full and minified file in debug mode

北城以北 提交于 2019-12-12 09:53:02
问题 I have the following ScriptBundle defined in BundleConfig.cs- public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/js/yepnope").Include( "~/Scripts/yepnope.{version}.js")); } } It isn't in fact the only bundle, but that is all in there that is pertinent to the question - the rest is just other bundle definitions. When in "debug" mode as set in the web.config- <compilation debug="true" targetFramework="4.5"> Both the full

How to add media attribute to ASP.NET MVC4 style bundle

こ雲淡風輕ζ 提交于 2019-12-12 08:19:04
问题 In ASP.NET MVC4 application, style bundle is created using bundles.Add(new StyleBundle("~/css/pos.css") .Include("~/css/mypos.css")); and rendered in view as @Styles.Render("~/css/pos.css") Generated output in debug mode is <link href="/myapp/css/mypos.css" rel="stylesheet"/> How to add media attribute to output so that style is used for screen <link href="/myapp/css/mypos.css" media="screen" rel="stylesheet"/> or for print <link href="/myapp/css/mypos.css" media="print" rel="stylesheet"/> Or

Mvc4 datatables does not work in script bundle

白昼怎懂夜的黑 提交于 2019-12-12 05:39:27
问题 I have following code in the App_Start/BundleConfig.cs bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/datatable").Include( "~/Content/DataTables-1.10.7/media/js/jquery.dataTables.min.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/site.css", "~/Content/DataTables-1.10.7/media/css/jquery.dataTables.min.css")); and in the Views/Shared/_Layout.cshtml @Styles.Render("~/Content/css")

MVC 5, globalize, validate german date: How to bundle the js-scripts?

女生的网名这么多〃 提交于 2019-12-12 04:14:35
问题 In the answer to this question (MVC 5 - can not get globalisation running) I solve the problem with a bunch of "<sript src="..." declarations and some js. What I not managed: I want to bundle the scripts. If I try it like this (excerpt from bundleConfig.cs): bundles.Add(new ScriptBundle("~/bundles/jqueryvalDe").Include( "~/Scripts/jquery.validate.js", "~/Scripts/jquery.validate.unobtrusive.js", "~/Scripts/cldr.js", "~/Scripts/cldr/event.js", "~/Scripts/cldr/supplemental.js", "~/Scripts/cldr

Bundling and Minification of AWS CloundFront CDN files using ASP.NET MVC?

别来无恙 提交于 2019-12-12 03:02:23
问题 Bundling: It’s a simple logical group of files that could be referenced by unique name and being loaded with on HTTP requestor. Minification: It’s process of removing unnecessary whitespace, line breaks, and comments from code to reduce its size thereby improving load times. Here is my idea, Basically I use multiple CCS, JS, and Image files for modularity, readability and maintainability of the code. Here multiple JS and CSS files require multiple HTTP requests from the browser leads to