Skip to content

Commit 278872e

Browse files
committed
Fix ts-node launch configuration
1 parent 9bc083b commit 278872e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"request": "launch",
1010
"name": "Launch Current File",
1111
"runtimeExecutable": "node",
12-
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
12+
"runtimeArgs": ["--import", "./ts-node.register.mjs"],
1313
"program": "${file}",
1414
"cwd": "${workspaceRoot}",
1515
"internalConsoleOptions": "openOnSessionStart",

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"name": "advent-of-code-2024",
33
"version": "0.1.0",
44
"description": "Solutions for Advent of Code 2024 in TypeScript",
5+
"type": "module",
56
"main": "dist/index.js",
67
"scripts": {
7-
"node-start": "ts-node",
8+
"node-start": "ts-node-esm",
89
"node-build": "tsc",
910
"test": "npm run build"
1011
},

ts-node.register.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { pathToFileURL } from 'node:url';
2+
import { register } from 'node:module';
3+
4+
register('ts-node/esm', pathToFileURL('./'));

0 commit comments

Comments
 (0)