Skip to content

Commit

Permalink
Renaming Bundle, cleaning up .min files so we aren't testing mapping …
Browse files Browse the repository at this point in the history
…to them, addings mimeType for .map files, testing mapping to transformed JS file.

Incremented version to 2.0.0.0 to follow semver given this rename isn't backwards compatible.
  • Loading branch information
benmccallum committed Mar 15, 2015
1 parent 27fdb77 commit 4661ae3
Show file tree
Hide file tree
Showing 19 changed files with 385 additions and 124 deletions.
19 changes: 14 additions & 5 deletions AspNetBundling.TestWebsite/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ public class BundleConfig
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new AjaxMinScriptBundle("~/bundles/jquery")
bundles.Add(new ScriptWithSourceMapBundle("~/bundles/jquery")
.Include("~/Scripts/jquery-{version}.js"));

bundles.Add(new AjaxMinScriptBundle("~/bundles/jqueryval")
bundles.Add(new ScriptWithSourceMapBundle("~/bundles/jqueryval")
.Include("~/Scripts/jquery.validate*"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new AjaxMinScriptBundle("~/bundles/modernizr")
bundles.Add(new ScriptWithSourceMapBundle("~/bundles/modernizr")
.Include("~/Scripts/modernizr-*"));

bundles.Add(new AjaxMinScriptBundle("~/bundles/bootstrap")
.Include("~/Scripts/bootstrap.js", "~/Scripts/respond.js"));
bundles.Add(new ScriptWithSourceMapBundle("~/bundles/bootstrap")
.Include("~/Scripts/bootstrap.js")
.Include("~/Scripts/respond.js", new TestJsTransformer()));

bundles.Add(new StyleBundle("~/Content/css")
.Include("~/Content/bootstrap.css", new CssRewriteUrlTransformFixed())
Expand All @@ -32,4 +33,12 @@ public static void RegisterBundles(BundleCollection bundles)
BundleTable.EnableOptimizations = true;
}
}

public class TestJsTransformer : IItemTransform
{
public string Process(string includedVirtualPath, string input)
{
return input.Replace("if( href.length ){ href += \"/\"; }", "if( href && href.length && href.length > 0 ){ href += \"/\"; }");
}
}
}
4 changes: 0 additions & 4 deletions AspNetBundling.TestWebsite/AspNetBundling.TestWebsite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,14 @@
<Content Include="Global.asax" />
<Content Include="Content\Site.css" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="Scripts\jquery-1.10.2.js" />
<Content Include="Scripts\jquery-1.10.2.min.js" />
<None Include="Scripts\jquery.validate-vsdoc.js" />
<Content Include="Scripts\jquery.validate.js" />
<Content Include="Scripts\jquery.validate.min.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.js" />
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Scripts\modernizr-2.6.2.js" />
<Content Include="Scripts\respond.js" />
<Content Include="Scripts\respond.min.js" />
<Content Include="Scripts\_references.js" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
Expand Down
Binary file modified AspNetBundling.TestWebsite/Scripts/_references.js
Binary file not shown.
21 changes: 0 additions & 21 deletions AspNetBundling.TestWebsite/Scripts/bootstrap.min.js

This file was deleted.

23 changes: 0 additions & 23 deletions AspNetBundling.TestWebsite/Scripts/jquery-1.10.2.min.js

This file was deleted.

16 changes: 0 additions & 16 deletions AspNetBundling.TestWebsite/Scripts/jquery.validate.min.js

This file was deleted.

20 changes: 0 additions & 20 deletions AspNetBundling.TestWebsite/Scripts/respond.min.js

This file was deleted.

Loading

0 comments on commit 4661ae3

Please sign in to comment.