bundling-and-minification

MVC4 style bundle giving 403

不打扰是莪最后的温柔 提交于 2019-11-27 09:43:34
问题 When bundling/minification is enabled, some of my bundles seem to have an invalid URL in the browser (ending with a /), and IIS gives a 403 forbidden error, as if trying to list a folder's contents. There's no difference in the way my bundles are set up - they are not .min.css, access permissions are correct etc. 回答1: My bundles were registered as paths which corresponded to an actual folder on the solution, e.g. ~/Content/forum . This works fine when bundling is turned off (the bundle is

Dotless - Can't reference less variable in separate file with MVC Bundling

和自甴很熟 提交于 2019-11-27 07:41:38
问题 I hope I'm not creating a duplicate topic, but I've been searching for two days and can't find a solution to this. We are starting a new project in MVC4 and we have the less version of bootstrap loaded. The issue I'm running into is when I try to reference some classes or variables in the bootstrap.less , my global.less , or any thing outside the current file. I can create a variable in the top of the current file and use it just fine, but if I want to use something out of a separate file, I

Scripts.Render using outdated javascript file

你说的曾经没有我的故事 提交于 2019-11-27 07:22:11
问题 My MVC4 application is using Scripts.Render to load a bundle that is loading a file called "functions.js." When I debug this application in the browser, the script loads, but the version is outdated. When I view the resource directly, but append ?v=anytext the script looks correct, but without that appended, the script shows the old code. Is there a way to force the bundling to output the correct file instead of a stale one? 回答1: This is likely a caching issue. When using Bundling and

Ordering of Files within a bundle - What are the known libraries?

若如初见. 提交于 2019-11-27 06:42:28
问题 In Bundling and Minification, I've known that the bundler will move around certain known file types -- so that things like jQuery will be moved to the front. By default, when files are bundled by ASP.NET they are sorted alphabetically first, just like they are shown in Solution Explorer. Then they are automatically shifted around so that known libraries and their custom extensions such as jQuery, MooTools and Dojo are loaded before anything else. -source But after reading this recent question

Usage of the ASP.NET MVC4 jquery/javascript bundles

守給你的承諾、 提交于 2019-11-27 06:41:11
when I created my project with the standard MVC4 template, there was ALOT of javascript included, e.g: jquery-obtrusive, jquery-validate, knockout, the entire jQuery UI. How much of this is worth keeping and how much is throw away? I've noticed when you create a strongly typed Controller the create.cshtml view generated calls: @section Scripts { @Scripts.Render("~/bundles/jqueryval") } What exactly does this file do? Should I keep it? Should I reference all of these JS files that were initially defined in BundleConfig.cs? Or can I not bother..? What exactly does this file do? jqueryval is not

How to force BundleCollection to flush cached script bundles in MVC4

拈花ヽ惹草 提交于 2019-11-27 06:21:51
... or how I learned to stop worrying and just write code against completely undocumented APIs from Microsoft . Is there any actual documentation of the official System.Web.Optimization release? 'cuz I sure can't find any, there's no XML docs, and all the blog posts refer to the RC API which is substantially different. Anyhoo.. I am writing some code to automatically resolve javascript dependencies and am creating bundles on the fly from those dependencies. Everything works great, except if you edit scripts or otherwise make changes that would affect a bundle without restarting the application

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

百般思念 提交于 2019-11-27 04:17:42
问题 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 think of bundling scripts or other resources when using HTTP/2? What is in HTTP/2 which makes this feature enable? 回答1: HTTP/2 supports "server push" which obsoletes bundling of resources. So,

MVC Bundling and CSS relative URLs

≡放荡痞女 提交于 2019-11-27 03:33:46
MVC's bundling is returning the wrong URL in CSS images when using CssRewriteUrlTransform: I have an intranet application whose URL is, for example: http://usid01-srv002/MyApplication . It's in IIS's "Default Web Site". Which has the following in BundleConfig.cs : bundles.Add(new StyleBundle("~/bundles/jcss") .Include("~/Scripts/JQueryUI/css/*.css", new CssRewriteUrlTransform()) ); The bundling system is generating the wrong URL for any images referenced in those CSS files, yielding 404's even JQueryUI's very well tested CSS files (from FireBug): e.g. it's generating http://usid01/path/foo.png

Angular 2: Reduce app size (in addition to bundling/minification)

♀尐吖头ヾ 提交于 2019-11-27 03:25:24
问题 I have a small-medium size (~28 KB including just the (TypeScript transpiled) JS + HTML templates) Angular 2 app. It's based originally on the angular.io quickstart, but now I am bundling/minifying it using JSPM for deployment. The bundled JS file I get is 2.1 MB, coming down to 449 KB when served with gzip compression. This is still rather large, and I would like to ask how best to go about reducing the overall size of the app for deployment, to deliver my app in the smallest and most

How can you bundle Angular 2 using System JS Builder?

你。 提交于 2019-11-27 01:49:29
问题 I'm currently using System JS with System JS Builder to bundle up my application, its assets, and the libraries that it references. My problem is that I can bundle libraries that are referenced explicitly in the index.html, e.g: <script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/Reflect.js"></script> <script src="node_modules/systemjs/dist/system.src.js"></script> However, I can't