Skip to content

Commit

Permalink
fix: Making it easy to run example with Node 20
Browse files Browse the repository at this point in the history
ts-node + ESM + Node 20 has issues. This should fix the startup of the examples.
  • Loading branch information
moufmouf committed Dec 13, 2023
1 parent 18d175e commit 38a98e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ async function run() {
console.log("Optimization finished");
}

run();
run().catch((err) => {
console.error(err);
process.exit(1);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "tsc --build",
"lint": "eslint --ext .js,.ts .",
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
"dev": "ts-node-esm --experimental-specifier-resolution=node ./example/index.ts"
"dev": "node --loader ts-node/esm --experimental-specifier-resolution=node ./example/index.ts"
},
"dependencies": {
"@workadventure/tiled-map-type-guard": "^2.1.1",
Expand Down

0 comments on commit 38a98e2

Please sign in to comment.