Skip to content

Commit c5b6b34

Browse files
devversionalan-agius4
authored andcommitted
build: avoid use of ts-node wrapper script as it breaks child process forking
`ts-node` spawns a custom node launcher script and has a brotli-base64 encoded configuration that will point to the user-provided entry-point. This breaks child process forking as we wouldn't be able to specify our custom build worker and basically `ng-dev` would run inside `ng-dev` again.
1 parent 7dc4444 commit c5b6b34

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"scripts": {
2525
"lint": "eslint --cache --max-warnings=0 \"**/*.ts\"",
26-
"ng-dev": "ts-node --esm --project .ng-dev/tsconfig.json node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.mjs",
26+
"ng-dev": "cross-env TS_NODE_PROJECT=$PWD/.ng-dev/tsconfig.json TS_NODE_TRANSPILE_ONLY=1 node --no-warnings --loader ts-node/esm node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.mjs",
2727
"build": "npm run bazel:build",
2828
"bazel:build": "bazel build //modules/...",
2929
"test": "bazel test //modules/...",
@@ -71,6 +71,7 @@
7171
"@typescript-eslint/parser": "5.29.0",
7272
"browser-sync": "^2.26.7",
7373
"critters": "0.0.16",
74+
"cross-env": "^7.0.3",
7475
"domino": "^2.1.2",
7576
"esbuild": "^0.14.0",
7677
"eslint": "8.18.0",

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3473,14 +3473,21 @@ [email protected]:
34733473
postcss "^8.3.7"
34743474
pretty-bytes "^5.3.0"
34753475

3476+
cross-env@^7.0.3:
3477+
version "7.0.3"
3478+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
3479+
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
3480+
dependencies:
3481+
cross-spawn "^7.0.1"
3482+
34763483
34773484
version "3.1.5"
34783485
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
34793486
integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
34803487
dependencies:
34813488
node-fetch "2.6.7"
34823489

3483-
cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
3490+
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
34843491
version "7.0.3"
34853492
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
34863493
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==

0 commit comments

Comments
 (0)