bundling-and-minification

MVC4 partial view javascript bundling Issue

自作多情 提交于 2019-11-28 01:53:10
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 rendered on my _Layout.cshtml page) have not yet loaded when the document ready code runs. <script type="text

jquery 1.9.0 and modernizr cannot be minified with the ASP.NET Web Optimization Framework

微笑、不失礼 提交于 2019-11-27 20:02:21
问题 We are using the ASP.NET Web Optimization Framework with bundles and minification. One bundle just contains jquery and modernizr. This all worked fine with jquery 1.8.3 but since we updated to 1.9.0 the combination jquery/modernizer bundle is not working anymore. bundles.Add(new ScriptBundle("~/st-scripts-load-first.js") .Include("~/Resources/JavaScript/jquery-1.9.0.js", "~/Resources/JavaScript/modernizr.form-placeholder.js")); We have both jquery-1.9.0.js and jquery-1.9.0.min.js in the

Mvc4 bundling, minification and AngularJS services

不想你离开。 提交于 2019-11-27 19:42: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. So $scope should remain $scope, as well as any other parameter in angular controllers. Everything else,

Why bundle optimizations are no longer a concern in HTTP/2

吃可爱长大的小学妹 提交于 2019-11-27 18:44:47
I read in bundling parts of systemjs documentation that bundling optimizations no longer needed in HTTP/2 : Over HTTP/2 this approach may be preferable as it allows files to be individually cached in the browser meaning bundle optimizations are no longer a concern. My questions: It means we don't need to think of bundling scripts or other resources when using HTTP/2? What is in HTTP/2 which makes this feature enable? HTTP/2 supports "server push" which obsoletes bundling of resources. So, yes, if you are you using HTTP/2, bundling would actually be an anti-pattern. For more info check this:

Bundling scripts are not getting rendered

﹥>﹥吖頭↗ 提交于 2019-11-27 16:07:44
I am having a problem with script bundling and minification with ASP .NET I have tried all popular solution found on internet but still having the same problem. My BundleConfig.cs looks like namespace MYPROJ{ public class BundleConfig { public static void AddDefaultIgnorePatterns(IgnoreList ignoreList) { if (ignoreList == null) return; ignoreList.Ignore("*.intellisense.js"); ignoreList.Ignore("*-vsdoc.js"); ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled); ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled); ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled); }

Reconciling ASP.NET script bundles and source maps

大兔子大兔子 提交于 2019-11-27 13:52:34
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? 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 . Nothing built in yet, although I wish it was. That being said, if you don't have to use the built in optimizer you could opt for Web essentials found here and use it to

Adding the new ASP.NET Web Optimization framework to MVC4 projects after manually upgrading them

扶醉桌前 提交于 2019-11-27 12:28:24
问题 After manually upgrading an ASP.NET MVC project to MVC4 using these instructions, how do you then set up the new CSS and JavaScript asset bundling and minimization features of the ASP.NET Web Optimization Framework in MVC4? The default templates have this all set up, but how do you do it by hand? 回答1: Right click References then Manage NuGet Packages and add “Microsoft.AspNet.Web.Optimization” (or type Install-Package Microsoft.AspNet.Web.Optimization into the NuGet console). In your Web

ASP.NET Bundling - Bundle not updating after included file has changed (returns 304 not modified)

倖福魔咒の 提交于 2019-11-27 11:24:54
I am trying out ASP.NET Bundling with ASP.NET MVC 4 application. The situation is that I want to make a CDN style service, which has JS and CSS files to which you can address from other sites with this type address: http://www.mycdn.com/scripts/plugin/js , which bundles and minifies all included .js files. My bundle config for one file looks like this: bundles.Add(new ScriptBundle("~/Scripts/plugin/pluginjs").Include("~/Scripts/plugin/jquery.plugin.js")); However, when I do this, the bundles are not getting updated even after I change the original js files. I keep on getting 304 Not Modified,

Bundling and minification without ASP.NET MVC

筅森魡賤 提交于 2019-11-27 11:14:15
问题 Is it possible to use bundling and minification from Microsoft.AspNet.Web.Optimization without having an MVC project? I'm creating an AngularJS site communicating with a REST API. For the REST API I'm using ASP.NET Web API. I have also created an "ASP.NET Empty Web Application". There are only HTML, js and CSS files in this project (and a web.config). I'd like for my js and CSS files to be bundled and minified, but I don't want to create a MVC project just to get that. Is it possible? 回答1: It

ASP.NET MVC4 Bundling with Twitter Bootstrap

风格不统一 提交于 2019-11-27 11:07:18
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( "~/Static/Js/jquery-1.7.2.js", "~/Static/Js/bootstrap/bootstrap.js", "~/Static/Js/cookie/jquery.cookie.js")