bundling-and-minification

MVC bundles and IIS virtual directories (URL rewrite)

馋奶兔 提交于 2019-12-10 03:12:34
问题 I'm hosting multiple applications on IIS server virtual directories and I'm using URL Rewrite to facilitate them. All images and other assets that are manually written like this "~/path/to/my/content" has a correct output "/path/to/my/content" , but bundle paths like "~/client/js" gives an output "/myapplication/client/js" which should be "/client/js" . How can I fix that? How I initiate Script bundle: var scriptBundle = new ScriptBundle("~/client/js"); Rewrite configuration: <rule name=

How to resolve Antlr3 dependency hell

柔情痞子 提交于 2019-12-09 14:36:45
问题 I have a asp.net MVC 4 project with MEF and RavenBD. When the project loads it throws this exception : Could not load file or assembly Antlr3.Runtime.dll I have found that both RavenDB and WebGrease (installed with MVC 4) use Antlr3. But WebGrease comes with its own Antlr3 dll, signed by Microsoft - PublicKeyToken 31bf3856ad364e35 Antlr3 default PublicKeyToken is eb42632606e9261f. RavenDB and WebGrease use the same version of Antlr3 3.3.1.7705 How can I resolve this problem? 回答1:

mvc4 bundling strongly typed bundles

心已入冬 提交于 2019-12-09 13:01:47
问题 So MVC 4 introduces script and style bundling. Which allows for this: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/mobile").Include( "~/Scripts/jquery.mobile-*")); then used in a razor view like this: @Scripts.Render("~/bundles/mobile") My question is why do I have to type "~/bundles/mobile" ? Is there a way get intellisence to have a strongly typed object to pick up on? Otherwise I have to go look it up to make sure I call it the same

Fingerprinting externally generated static content (ASP.NET + browserify)

不想你离开。 提交于 2019-12-09 09:44:41
问题 Nodejs browserify is terrific when building modular js apps. If gulp is part of the setup as well, the workflow is further enhanced to manage and resolve dependencies, properly bundle, uglify with sourcemaps, auto-polyfill, jshint, test... This is pretty handy for css as well with pre-processing, auto-prefixing, linting, embedding resources and generating documentation. TL;DR: with npm/bower you get access to an extensive ecosystem of front-end libraries, making nodejs perfect for building

ASP.NET Bundling/Minification and Embedded Resources

£可爱£侵袭症+ 提交于 2019-12-09 04:44:55
问题 I'm trying to use the technique described in this blog to add embedded dll resources to my bundles. I have created the custom VirtualPathProvider below. public class EmbeddedVirtualPathProvider : VirtualPathProvider { private Type _rootType; public EmbeddedVirtualPathProvider(Type rootType) { _rootType = rootType; } public override bool FileExists(string virtualPath) { if (IsEmbeddedPath(virtualPath)) return true; else return Previous.FileExists(virtualPath); } public override CacheDependency

How to reference the bundled js files (asp.net mvc4) in Require.js?

回眸只為那壹抹淺笑 提交于 2019-12-09 04:27:50
问题 I have been studying John Papa's pluralsight course on SPA. In his main.js , he gave a name to each js library which is included in the bundle. (function () { var root = this; define3rdPartyModules(); function define3rdPartyModules() { // These are already loaded via bundles. // We define them and put them in the root object. define('jquery', [], function () { return root.jQuery; }); define('ko', [], function () { return root.ko; }); define('amplify', [], function () { return root.amplify; })

MVC bundeling : Err 403

二次信任 提交于 2019-12-09 02:24:01
问题 Using VS'12, Asp.net - C# - InternetApplication Template, KendoUI, EF Code First This is my MVC BundleConfig.cs bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); // The Kendo CSS bundle bundles.Add(new StyleBundle("~/Content/kendo").Include( "~/Content/kendo/kendo.common.*", "~/Content/kendo/kendo.default.*")); // The Kendo JavaScript bundle// or kendo.all.min.js if you want

Running an ASP.NET MVC 4 app in release mode does not bundle and minifiy the js files

霸气de小男生 提交于 2019-12-09 02:22:08
问题 When I run my ASP.NET MVC 4 app in release mode, the bundles are still outputting the unminified and separate js files, instead of bundling and minifying it into fewer bundled JavaScript files. Any ideas? FYI, release config: <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> </system.web> </configuration> 回答1: Thanks to aleyush's comment that Web.release.config is only used

RequireJS - ASP.NET MVC Bundle Script

僤鯓⒐⒋嵵緔 提交于 2019-12-08 17:14:51
问题 I have two questions. I am trying to learn RequireJS and use it along with ASP.NET MVC bundling & minification. I am using a separate config file for RequireJS which holds the bundling information. My first problem is how do I pass on the bundle path generated by MVC to the require.config.js file. A clean way to do that will be as below: index.cshtml <script id="requirescript" type="text/javascript" src="~/Scripts/require.config.js" data-baseurl="@Url.Content("~/Scripts")" data-bundlepath="

MVC5 bundle url version and content are missing

一笑奈何 提交于 2019-12-08 11:23:08
问题 In my MVC5 web application I use two bundles for a page, one contains the common JavaScript files for all the pages and the other bundle is specific for the page. This works fine in development environment but the page specific bundle does not load in the staging. The Rendered script tags are as below. <script src="/bundles/jsAll?v=72eJMPeVrT1mvbZw1VAU7y6r7vodOImt5NOMq4Gcp581"></script> <script src="/bundles/my-page?v="></script> Could not figure out why this happens... 回答1: The problem was