From 91c9200c31977ecb179172cb67d288dc0ba390f3 Mon Sep 17 00:00:00 2001
From: Paul Gschwendtner <paulgschwendtner@gmail.com>
Date: Sat, 18 Jun 2022 12:55:57 +0000
Subject: [PATCH] fix(ng-dev): avoid ts-node esm shebang that breaks on windows

Consumers should instead run `ts-node` as well. They need to pass in
the project manually anyway already, so it also makes this portion
easier by just having to directly use `ts-node` with `--project`.
---
 ng-dev/cli.ts      | 3 ++-
 tools/local-dev.sh | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ng-dev/cli.ts b/ng-dev/cli.ts
index d11170352..3306e32c1 100644
--- a/ng-dev/cli.ts
+++ b/ng-dev/cli.ts
@@ -1,4 +1,5 @@
-#!/usr/bin/env -S node --loader ts-node/esm --no-warnings
+#!/usr/bin/env node
+
 /**
  * @license
  * Copyright Google LLC All Rights Reserved.
diff --git a/tools/local-dev.sh b/tools/local-dev.sh
index afd1272c9..59fa8e1c8 100755
--- a/tools/local-dev.sh
+++ b/tools/local-dev.sh
@@ -19,4 +19,4 @@ bazelCommand=${BAZEL:-"yarn bazel"}
 
 # Execute the built ng-dev command in the current working directory
 # and pass-through arguments unmodified.
-${ngDevBinFile} ${@}
+yarn ts-node --esm --project .ng-dev/tsconfig.json ${ngDevBinFile} ${@}