bundling-and-minification

gulp minify all css files to a single file

会有一股神秘感。 提交于 2019-11-27 00:40:35
问题 I have gulp task script as following, // loads various gulp modules var gulp = require('gulp'); var concat = require('gulp-concat'); var minifyCSS = require('gulp-minify-css'); var autoprefixer = require('gulp-autoprefixer'); var rename = require('gulp-rename'); // create task gulp.task('css', function(){ gulp.src('src/css/**/*.css') .pipe(minifyCSS()) .pipe(rename('style.min.css')) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9')) .pipe(gulp.dest('dist/css')) }); How to

CssRewriteUrlTransform with or without virtual directory

若如初见. 提交于 2019-11-27 00:16:47
We are using MVC Bundling in our site, CssRewriteUrlTransform makes sure that the image urls work from the dynamic bundle css file. But this only works when not using a virtual directory, i.e http://localhost/VirttualDir does not work but http://localhost/ does. This is because the CssRewriteUrlTransform tranform does not take the virtual folder into account when rewriting the url. So if a image real path is localhost/vdir/content/img/foo.png it will rewrite it to localhost/content/img/foo.png which is wrong BernardG I am not sure to fully understand your problem, but seeing http://localhost

Mvc4 bundling, minification and AngularJS services

北城以北 提交于 2019-11-26 22:50:57
问题 Is there a way to customize the way Asp.Net MVC4 bundling&minification feature minifies the js files? Meaning, I don't want to completely turn off minification, but "as is" it just breaks AngularJs. Since AngularJs uses DI and IoC approach for injecting services in controllers, the following: function MyController($scope) { } Once minified, becomes: function MyController(n) { } Normally that wouldn't be a problem, but AngularJs uses the parameter names to understand which service to inject.

MVC4 partial view javascript bundling Issue

人走茶凉 提交于 2019-11-26 22:04:28
问题 I am working on a project ASP.net 4, MVC4(RC) using visual studio 11. I am trying to render an MVC4 Razor view that renders a partial view. I have some javascript required for my partial view. On my partial view when I include my javascript inside the scripts section as follows it does not seem to load. @section Scripts { <script type="text/javascript"> $(function () { alert("test"); }); </script> } If I remove the scripts section it fails as the jquery libraries (which are bundled and

Force ASP.Net MVC Bundle to render the javascript files in a certain order

时光毁灭记忆、已成空白 提交于 2019-11-26 20:28:01
问题 I am working on an ASP.Net MVC 4 application and using Bundling and minifiction to render styles and script files. I have a script file ( File A ) that call function in another file ( File B ) , when I am using @Scripts.Render() method it render link tag for File A before File B so it fire an error and the script not work correctly. Is there any way to force @Script.Render() to render link tags in certain order without using separate bundle for each file???? EDIT I am using IncludeDirectory

How to prevent User-Agent: Eureka/1 to return source code

人走茶凉 提交于 2019-11-26 18:30:46
问题 ASP.NET Mono MVC 4 application uses MVC4 built in bundling and minification for css and js files. If user agent string in request is changed to Eureka/1 using fiddler User-Agent: Eureka/1 and request is re-issued, whole source code with all comments are sent to client. How to prevent this so that comments in source code code cannot inspected by client ? Source: http://www.codeproject.com/Articles/728146/ASP-NET-MVC-bundles-internals I tried to add debug='false' to web.config but problem

Reconciling ASP.NET script bundles and source maps

↘锁芯ラ 提交于 2019-11-26 16:30:36
问题 Is there any way to set up the default System.Web.Optimization.ScriptBundle to generate source maps for the bundled and minified files? Is there an equivalent solution, other than having to pre-generate the bundles and source maps before each build? 回答1: It looks like in the meantime some kind soul has released a custom class that does exactly what I need. You can get his source at https://github.com/benmccallum/AspNetBundling. 回答2: Nothing built in yet, although I wish it was. That being

ASP.NET MVC4 Bundling with Twitter Bootstrap

偶尔善良 提交于 2019-11-26 15:26:08
问题 I'm trying to use the new bundling feature in MVC 4 with Twitter bootstrap and it seems to me like the paths to the glyphicons png-files int the css get's messed up in some way. Heres my code: bundles.Add(new StyleBundle("~/bundles/publiccss").Include( "~/Static/Css/bootstrap/bootstrap.css", "~/Static/Css/bootstrap/bootstrap-padding-top.css", "~/Static/Css/bootstrap/bootstrap-responsive.css", "~/Static/Css/bootstrap/docs.css")); bundles.Add(new ScriptBundle("~/bundles/publicjs").Include( "~

How to force BundleCollection to flush cached script bundles in MVC4

℡╲_俬逩灬. 提交于 2019-11-26 12:37:12
问题 ... or how I learned to stop worrying and just write code against completely undocumented APIs from Microsoft . Is there any actual documentation of the official System.Web.Optimization release? \'cuz I sure can\'t find any, there\'s no XML docs, and all the blog posts refer to the RC API which is substantially different. Anyhoo.. I am writing some code to automatically resolve javascript dependencies and am creating bundles on the fly from those dependencies. Everything works great, except

Usage of the ASP.NET MVC4 jquery/javascript bundles

我是研究僧i 提交于 2019-11-26 12:06:59
问题 when I created my project with the standard MVC4 template, there was ALOT of javascript included, e.g: jquery-obtrusive, jquery-validate, knockout, the entire jQuery UI. How much of this is worth keeping and how much is throw away? I\'ve noticed when you create a strongly typed Controller the create.cshtml view generated calls: @section Scripts { @Scripts.Render(\"~/bundles/jqueryval\") } What exactly does this file do? Should I keep it? Should I reference all of these JS files that were