Last active
December 19, 2015 09:39
-
-
Save johnnyreilly/5934706 to your computer and use it in GitHub Desktop.
TypeScript and Cassette
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../../typings/jquery/jquery.d.ts" /> | |
// @reference ~/bundles/core | |
$(document).ready(function () { | |
var $body = $("#body"); | |
$body.fadeOut(1000, function () { | |
$body.html('<div style="width: 150px; margin: 0 auto;">I made it all go away...</div>').fadeIn(); | |
}); | |
}); | |
//@ sourceMappingURL=Index.js.map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../../typings/jquery/jquery.d.ts" /> | |
// @reference ~/bundles/core | |
$(document).ready(function () { | |
var $body = $("#body"); | |
$body.fadeOut(1000, function () { | |
$body.html('<div style="width: 150px; margin: 0 auto;">I made it all go away...</div>') | |
.fadeIn(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cassette.BundleProcessing; | |
using Cassette.Scripts; | |
namespace CassetteDemo | |
{ | |
public class InsertIntoPipelineParseJavaScriptNotTypeScriptReferences : IBundlePipelineModifier<ScriptBundle> | |
{ | |
public IBundlePipeline<ScriptBundle> Modify(IBundlePipeline<ScriptBundle> pipeline) | |
{ | |
var positionOfJavaScriptReferenceParser = pipeline.IndexOf<ParseJavaScriptReferences>(); | |
pipeline.RemoveAt(positionOfJavaScriptReferenceParser); | |
pipeline.Insert<ParseJavaScriptNotTypeScriptReferences>(positionOfJavaScriptReferenceParser); | |
return pipeline; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Cassette.Scripts; | |
namespace CassetteDemo | |
{ | |
public class ParseJavaScriptNotTypeScriptReferences : ParseJavaScriptReferences | |
{ | |
protected override bool ShouldAddReference(string referencePath) | |
{ | |
return !referencePath.EndsWith(".ts", StringComparison.OrdinalIgnoreCase); // Will exclude TypeScript files from being served | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment