asp.net-bundling

Is there a way to update asp.net mvc bundle contents dynamically at run-time?

南楼画角 提交于 2020-01-13 08:42:30
问题 I'm ASP.NET MVC v4 for my application, and I'm using the web optimization features (bundling and minification of scripts and styles). Now, what I understand is (please correct me if wrong), the optimization framework will look at the included files at the time of compilation and configure them. It'll create a version number (v=something) based on the contents. Every time the contents change, it'll recreate the version hash, and the client will get updated files. Now, is there a way to get the

Migrating ASP.NET MVC 5 bundling “versions” to MVC 6

。_饼干妹妹 提交于 2019-12-23 09:31:59
问题 The bundling feature is excluded from MVC 6 and the suggested method is to do bundling using gulp tasks. Using bundling we used to get a random string at the end of the included css/javascript file url(s). This string was very important because once you changed anything in your css/javascript then a new string would be generated which would force browsers to load the new version(s) of the file(s). So if you had 3 css files they would be bundled into one and they would look like this: <link

Add additional ordered bundles to a DynamicFolderBundle?

吃可爱长大的小学妹 提交于 2019-12-13 18:39:47
问题 I have a DynamicFoldewrBundle : bundles.Add(new DynamicFolderBundle("userScripts", "*.js", true, new JsMinify())); So If I run : http://optimization.localtest.me/files/templates/designs/HelloTreble/ userScripts ...It will render all Javascript files bundled and minified in the HelloTreble folder. OK. Question : But how can I add custom ordered bundles to DynamicFolderBundle ? I have tried this : bundles.Add(new DynamicFolderBundle("userScripts", "*.js",new JsMinify()) .Include("~/Scripts/A.js

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

How to unit test ASP.NET bundles

本小妞迷上赌 提交于 2019-12-11 04:12:16
问题 I tried following this answer about testing unit tests but when I try to enumerate the files in the bundle to test, I always get count zero. What's the problem with the following code? [TestFixture] public class BundleConfigTests { private TestVirtualPathProvider _vpp; private BundleCollection _bundles; private HttpContextBase _httpContext; [SetUp] public void SetUp() { _vpp = new TestVirtualPathProvider(); var directory = new TestVirtualPathProvider.TestVirtualDirectory("/css/"); directory

Is there a way to update asp.net mvc bundle contents dynamically at run-time?

a 夏天 提交于 2019-12-05 03:55:15
I'm ASP.NET MVC v4 for my application, and I'm using the web optimization features (bundling and minification of scripts and styles). Now, what I understand is (please correct me if wrong), the optimization framework will look at the included files at the time of compilation and configure them. It'll create a version number (v=something) based on the contents. Every time the contents change, it'll recreate the version hash, and the client will get updated files. Now, is there a way to get the following done [1] Update something inside a js file in my server, and serve the updated one to the