bundling-and-minification

How to include non bundle and minified version of js and cs file during debugging

孤人 提交于 2019-12-12 02:53:49
问题 i want to load non bundle and non minified css and js file in my page when i am testing my web site or running my web site from VS IDE with debug mode but after debug when i will deploy the web site in IIS or run the web site from VS IDE with release mode then then always minified version js and css file should load. just guide me what to do or how to achieve this. i got a trick for the same from web site http://www.davepaquette.com/archive/2014/10/08/how-to-use-gulp-in-visual-studio.aspx @if

Unable to generate 'VersionQueryString' in Scripts.Render when using bundle

霸气de小男生 提交于 2019-12-11 20:31:37
问题 This my settings: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/" + Links.Scripts.jquery_2_1_1_min_js, "~/" + Links.Scripts.jquery_migrate_1_2_1_min_js, "~/" + Links.Scripts.calendar.jquery_ui_datepicker_cc_all_min_js )); } protected void Application_Start() { RegisterBundles(BundleTable.Bundles); BundleTable.EnableOptimizations = true; } Use this code in Layout view: @Scripts.Render("~/bundles/jquery") In VS no

What are the mechanics of producing bundled js and css files with master pages?

笑着哭i 提交于 2019-12-11 18:09:40
问题 I have a .NET Core project in which the master page _Layout.cshtml page references site wide style and js files: <link rel="stylesheet" href="~/css/site.css" /> <script src="~/js/site.js" asp-append-version="true"></script> The Index.cshtml page, which utilizes the above master page, references page specific style and js files: <link type="text/css" rel="stylesheet" href="~/css/landing.css"> <script src="~/js/landing.js" asp-append-version="true"></script> And then Contact.cshtml and About

Disabling bundling minification for specific file extension

时光总嘲笑我的痴心妄想 提交于 2019-12-11 10:17:39
问题 I'm in the process of switching my site over to less and I was wanting to continue the use of Web.Optimization however, it fails on compiling less. Is there a way to register .less{} as the processor for this or simply tell it to bundle, but not minify anything with a .less extension? 回答1: Take a look at this guide to bundling and minification. It contains an example on bundling LESS files. Essentially you create a class that implements IBundleTransform using System.Web.Optimization; public

Bundling & Minification in ASP.NET 3.5

这一生的挚爱 提交于 2019-12-11 09:52:19
问题 ASP.NET 4.5 includes a new feature to minify and bundle CSS and JavaScript within your web application. Is there anything similar to apply bundling and minification for CSS and JS files in ASP.NET 3.5 (Web forms)? 回答1: I think there is no built in tool is available in 3.5 You can use YUICompressor and add those compressed version in your page There is a YUICompressor for .Net is available 来源: https://stackoverflow.com/questions/20123344/bundling-minification-in-asp-net-3-5

How do we add Bundling and Minification to a project that was upgraded from Visual Studio 2010 project

∥☆過路亽.° 提交于 2019-12-11 08:08:27
问题 I upgraded a legacy website project developed using Visual Studio 2010 to a Web Application project in Visual Studio 2013. Now I want to add some MVC components to this application including Bundling and Minification. But the App_Start folder is missing. Is there any NuGet package I need to install that would create the App_Start folder and add the 'Bundling and Minification' feature? For instance, this project was also missing the 'Content' folder, but when I installed the jQuery UI 1.10.4

Customizing .NET 4.5 bundler/minifier

烈酒焚心 提交于 2019-12-11 03:58:07
问题 Is there a way to customize the output of the JavaScript minfier/bundler that comes with .NET 4.5 (Microsoft.Web.Optimization) with various minification options? For example, I want to allow local variable renaming but not allow function argument renaming. As a background, I'm trying to introduce an AngularJS app into a .NET application, and want to be able to use the bundling/minification framework that comes with .NET 4.5. I don't want function argument renaming to happen since AngularJS

Bundling fails because path mistaken for a controller path

↘锁芯ラ 提交于 2019-12-11 02:46:33
问题 In my BundleConfig I have bundles.Add(new StyleBundle("~/Content/css/css").Include("~/Content/css/wireframe.css?v=1.0")); In my view I have @Styles.Render("~/Content/css/css") But when I access the page concerned I get a 404 with this error [HttpException]: The controller for path '/Content/css/css' was not found or does not implement IController. It seems the path is being confused for a controller. Do I change my WebApiConfig and RouteConfig files? 回答1: Schoolboy error. I was missing this

Bundled scripts not working MVC

五迷三道 提交于 2019-12-11 02:39:38
问题 I have bundled jquery Validate scripts like : bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); and am rendering in the _Layout as @Scripts.Render("~/bundles/jqueryval") But when i try to Validate my form on button click like : $("form").validate({ errorPlacement: function (error, element) { error.insertAfter(element).css("display", "inline"); } }); Its giving me the error like : 0x800a01b6 - JavaScript runtime error:

How to bundle typescript files for the browser user gulp and tsproject?

我的梦境 提交于 2019-12-11 02:39:03
问题 I'm kinda new to front end development, being a long time backend C# and Java developer, and I'm trying to come to grips with how to build front end applications. I would like to build an application using typescript and use gulp for my build pipeline to transpile, bundle and minify my code to a single JavaScript file. For this purpose, I have been looking at the node module tsproject which, as far as I can understand, is supposed to do exactly what I want. Except, I can't get it to do what I