bundling-and-minification

Get MVC Bundle Querystring

一笑奈何 提交于 2019-11-30 09:37:57
Is it possible to detect a bundle querystring in ASP.NET MVC? For example if I have the following bundle request: /css/bundles/mybundle.css?v=4Z9jKRKGzlz-D5dJi5VZtpy4QJep62o6A-xNjSBmKwU1 Is it possible to extract the v querystring?: 4Z9jKRKGzlz-D5dJi5VZtpy4QJep62o6A-xNjSBmKwU1 I've tried doing this in a bundle transform, but with no luck. I found that even with UseServerCache set to false the transform code didn't always run. Its been a while since I've worked with the ASP Bundler (I remember it being total shit), and these notes are from my memory. Please verify its still valid. I will update

Asp.Net MVC4 Bundling & Minification .min.js files excluded from Scripts.Render?

拈花ヽ惹草 提交于 2019-11-30 09:17:09
I created some theme HtmlHelper extensions for that grab the .css and .js files in a theme directory and dynamically register them as bundles. However, if the theme only contains .min.js files, the Scripts.Render output is empty in debug mode. Is there a way to include *.min.js files in the output for Scripts.Render when in debug mode? Figured it out. BundleTable.Bundles.IgnoreList.Clear(); // apparently, IgnoreList included .min.js in debug BundleTable.Bundles.IgnoreList.Ignore(".intellisense.js", OptimizationMode.Always); BundleTable.Bundles.IgnoreList.Ignore("-vsdoc.js", OptimizationMode

MVC4 Bundle minification doesn't work with javascript reserved words

百般思念 提交于 2019-11-30 08:40:36
Using the latest version of MVC4 I can't minify javascript when it contains reserved words as key names! See the error below with the valid javascript that should have been minified. Does anyone know how to fix this short of rewriting the javascript to use [""] notation? PS The code in question is a few thousand lines long, so it's not an option! /* Minification failed. Returning unminified contents. (3,9-15): run-time warning JS1010: Expected identifier: delete (4,9-13): run-time warning JS1010: Expected identifier: case (5,9-11): run-time warning JS1010: Expected identifier: if (3,9-15): run

Error after Minification of angular js. Error: [$injector:unpr] Unknown provider: eProvider <- e <- makeErrorsDirective

旧巷老猫 提交于 2019-11-30 05:41:08
问题 I used Gulp to minify my entire js files. Once minified I got an error like the following: [$injector:unpr] Unknown provider: eProvider <- e <- makeErrorsDirective. I had a Custom directive in my controller file. var myhubdashboardControllers = angular.module('vpdashboardmodule', []); .directive('mhDashboard', function ($http, authService, apiService) { return { restrict: 'EA', scope: { name: '@', dash: '@', report: '@', disname: '@', disdesc: '@', distot: '@' }, templateUrl: 'views/dashboard

MVC4 bundling/minification with IE conditional comments

时光总嘲笑我的痴心妄想 提交于 2019-11-30 05:00:55
I am trying to use MVC4's new "bundling and minification". For IE conditional comments, I'm still doing it the old way: <!--[if lt IE 9]><link href=.../><![endif]--> or <!--[if lt IE 9]>@Styles.Render("~/foo")<![endif]--> but I don't seem to get the automatic debug/release handling. Is there a built-in way to do this? How are others doing this? EDIT: Also it would be great to be able to include <noscript> tags inside the rendered output (used for fallbacks). Until I find a better way, I made an adaptor class called Bundles , which has the method: public static IHtmlString RenderStylesIe(string

How do I configure MVC's style bundling order?

风流意气都作罢 提交于 2019-11-30 04:42:26
My web app is using a large icon set with jquery-ui and jqgrid. In order to easily maintain the changes to the CSS to accommodate the larger icons when upgrading jquery-ui or jqgrid I have a separate CSS file where I have a bunch of overrides. As you can imagine this override file MUST be included after the jquery-ui stylesheet and the jqgrid style sheet. I put all my stylesheets into a bundle like so bundles.Add(new StyleBundle("~/Content/dark-hive/allstyles").Include( "~/Content/dark-hive/jquery-ui-1.8.23.custom.css", "~/Content/ui.jqgrid.css", "~/Content/jquery-ui-fixes.css", "~/Content

Bundle Minification not working when publishing WebForms App

不羁的心 提交于 2019-11-30 01:18:01
问题 I'm trying to use bundle minification for some .css and .js files. My bundle config is the following: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/Modernizr").Include( "~/Scripts/modernizr.js" )); bundles.Add(new StyleBundle("~/TemplateContent").Include( "~/Content/bootstrap.css", "~/Content/bootstrap-responsive.css", "~/Content/prettyPhoto.css", "~/Content/prettify.css", "~/Content/flexslider.css", "~/Content/iview.css", "~/Content/style.css"

Webpack Uglify causes routing to stop work

旧巷老猫 提交于 2019-11-29 23:49:11
问题 When I uglify webpack bundle, routing stops work without any error message or log message. I am using oclazyload to lazy load. Route.js module.exports = function(app) { var routeConfig = function($stateProvider) { $stateProvider .state('home', { url: '/', templateUrl: 'app/dashboard/dashboard.min.html', title: 'Home', ncyBreadcrumb: { label: 'Home' } }) .state('organizationStructure', { url: '/organizationStructure', templateUrl: 'app/admin/organizationStructure/manageHierarchy

How do I use react.js without a bundler?

此生再无相见时 提交于 2019-11-29 17:44:07
问题 Recently I have been playing around with react.js and I like the speed that I can develop working UI components. I have now created quite a few components and I would like to distribute some of them among different .jsx files. Every thing I've read says that I should be using a bundler like browserify or webpacker whenever moving to production. However I am against this idea. Part of the reason I like developing in javascript is because its a scripted language and there is no compiler to muck

How to make bundles unminify and list individual files when using a cookieless static content server?

自作多情 提交于 2019-11-29 16:15:10
I have two VS projects, one for the main website and one for a "static content" website where all the css, js, images, and other static content will be stored and accessed via a cookieless domain. So I have a BundleConfig.cs in my static site that creates all the bundles: public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new StyleBundle("~/bundles/styles").IncludeDirectory("~/app/styles", "*.css", true)); bundles.Add(new ScriptBundle("~/bundles/scripts").IncludeDirectory("~/app/src", "*.js", true)); } } And in the main site I have another