Skip to content

Commit 9878f5a

Browse files
avens19Daniel15
authored andcommitted
Allow customization of file name extension for babel transpilation (#266)
1 parent 6d4dba6 commit 9878f5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/React.MSBuild/TransformBabel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public class TransformBabel : Task
3030
[Required]
3131
public string SourceDir { get; set; }
3232

33+
/// <summary>
34+
/// The file extension pattern of the JavaScript files to transpile. Optional, defaults to *.jsx
35+
/// </summary>
36+
public string FileExtensionPattern { get; set; } = "*.jsx";
37+
3338
/// <summary>
3439
/// Executes the task.
3540
/// </summary>
@@ -56,7 +61,7 @@ public override bool Execute()
5661
/// <returns><c>true</c> on success</returns>
5762
private bool ExecuteInternal()
5863
{
59-
var files = Directory.EnumerateFiles(SourceDir, "*.jsx", SearchOption.AllDirectories);
64+
var files = Directory.EnumerateFiles(SourceDir, FileExtensionPattern, SearchOption.AllDirectories);
6065
foreach (var path in files)
6166
{
6267
var relativePath = path.Substring(SourceDir.Length + 1);

0 commit comments

Comments
 (0)