bundling-and-minification

Create a Script bundle from multiple locations

旧街凉风 提交于 2020-01-29 04:38:11
问题 Let's assume our app is offline, i.e. we can't use 3rd party CDNs thus we're creating our own. I'd like to host all of the vendor scripts in a separate (Parent) web app and then include them in the bundles in several other MVC Apps. e.g. http://localhost/parentWeb/Scripts/jquery.js http://localhost/parentWeb/Scripts/jquery-ui.js http://localhost/parentWeb/Scripts/globalize.js I'd like to include in the ASP.NET MVC App Website located in: http://localhost/parentWeb/childWeb i.e. do something

Asp.Net bundling not using the .min files

≡放荡痞女 提交于 2020-01-23 06:58:46
问题 According to documentation in release mode the bundler should use the .min.js file if it exists. I am adding angular the following way: bundles.Add(new ScriptBundle(Bundles.Scripts).Include( "~/Content/Scripts/angular.js")); I have angular.js and angular.min.js in the same folder. So according to what I understand the bundler should just use the angular.min.js and do not do anything itself. But when I check the result in the http response, it's different. It's also minified, but all the names

Asp.Net bundling not using the .min files

五迷三道 提交于 2020-01-23 06:58:05
问题 According to documentation in release mode the bundler should use the .min.js file if it exists. I am adding angular the following way: bundles.Add(new ScriptBundle(Bundles.Scripts).Include( "~/Content/Scripts/angular.js")); I have angular.js and angular.min.js in the same folder. So according to what I understand the bundler should just use the angular.min.js and do not do anything itself. But when I check the result in the http response, it's different. It's also minified, but all the names

Angular js App minification

微笑、不失礼 提交于 2020-01-16 18:48:13
问题 Very popular issue: Unknown provider: nProvider <- n <- $http <- $templateFactory <- $view <- $state I use MVC Bundling for this. How to read this message? Does it mean that $state requires $view that requires $templateFactory etc.? 回答1: It was a problem in some external directives. So I go through all of them and fixed syntax of service injections: from app.service('myService', function($scope, $animate) {}); to app.service('myService', ['$scope', '$animate', function($scope, $animate) {}]);

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

AngularJS not working in release mode (minified)

谁说胖子不能爱 提交于 2020-01-12 18:24:47
问题 I have AngularJS, and Angular directives for Bootstrap in a project, both of which have been added via Nuget. When compilation debug="true" , everything works fine, but once I change compilation debug to false , Angular stops working, and I get the following error in Chrome's console: Error: [$injector:unpr] http://errors.angularjs.org/1.2.15/$injector/unpr?p0=nProvider%20%3C-%20n at Error (native) at http://localhost:10366/bundles/angular?v=Bi8OwYOhmsGdeIKC46ZQQdIHX1faTIVR48lG9QG3GBw1:1:448

AngularJS not working in release mode (minified)

余生颓废 提交于 2020-01-12 18:20:11
问题 I have AngularJS, and Angular directives for Bootstrap in a project, both of which have been added via Nuget. When compilation debug="true" , everything works fine, but once I change compilation debug to false , Angular stops working, and I get the following error in Chrome's console: Error: [$injector:unpr] http://errors.angularjs.org/1.2.15/$injector/unpr?p0=nProvider%20%3C-%20n at Error (native) at http://localhost:10366/bundles/angular?v=Bi8OwYOhmsGdeIKC46ZQQdIHX1faTIVR48lG9QG3GBw1:1:448

Minification issue on route config angular js & typescript min safe

大城市里の小女人 提交于 2020-01-07 03:52:26
问题 I have a bundle with several js files (generated by typescript files) When I use minification on the bundle, the page fails. The error on chrome console: Uncaught Error: [$injector:modulerr] Failed to instantiate module AppModule due to: Error: [$injector:unpr] Unknown provider: n I isolated the problem to one of two files, the app.module and the app.routes as follows: app.module: ((): void=> { var app = angular.module("AppModule", ['ngRoute', 'ngMessages', 'app.xxx.xxx.xxxModule',

Does MVC4 bundling and mimification do any caching?

假如想象 提交于 2020-01-03 19:40:28
问题 I would like to use the bundling and mimification features of MVC4 but I am concerned about the mimification. Is it the case that every time there is a request for css and javascript from a client that the bundling/mimification process works. If so then is there not a CPU overhead each time? 回答1: Quote: Bundling and minification primarily improve the first page request load time. Once a webpage has been requested, the browser caches the assets (JavaScript, CSS and images) so bundling and

Add multiple Bundles inside a single Bundle in C# MVC

谁说我不能喝 提交于 2020-01-02 05:30:53
问题 For Example I Want to Create Bundles like this /*These are my Two separate Bundles*/ bundles.Add(new StyleBundle("~/Content/MYBundle1").Include( "~/Content/css/style.css")); bundles.Add(new StyleBundle("~/Content/MYBundle2").Include( "~/Content/css/media.css")); /*Now i want to use above two bundles as a single bundle */ bundles.Add(new StyleBundle("~/Content/AllPageBundles").Include( "~/Content/MYBundle1", "~/Content/MYBundle2") Also I want to ask that can i add reference of any file inside