Skip to content

Commit 9993be5

Browse files
CopilotneSpecc
andauthored
Fix ERR_UNKNOWN_FILE_EXTENSION error when running TypeScript files with ts-node in ESM mode (#327)
* Initial plan * Fix ERR_UNKNOWN_FILE_EXTENSION by configuring ts-node loader for ESM Co-authored-by: neSpecc <[email protected]> * Bump version from 2.2.3 to 2.2.4 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: neSpecc <[email protected]> Co-authored-by: Peter <[email protected]>
1 parent 6c4d431 commit 9993be5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

nodemon.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
"watch": [
99
"**/*"
1010
],
11-
"ext": "ts,js,twig"
11+
"ext": "ts,js,twig",
12+
"execMap": {
13+
"ts": "node --loader ts-node/esm"
14+
}
1215
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codex.docs",
33
"license": "Apache-2.0",
4-
"version": "2.2.3",
4+
"version": "2.2.4",
55
"type": "module",
66
"bin": {
77
"codex.docs": "dist/backend/app.js"
@@ -14,7 +14,7 @@
1414
"start": "concurrently \"yarn start-backend\" \"yarn build-frontend\"",
1515
"dev": "concurrently \"yarn start-backend\" \"yarn build-frontend:dev\"",
1616
"build-all": "yarn build-frontend && yarn build-backend",
17-
"build-static": "ts-node src/backend/app.ts build-static -c docs-config.yaml -c docs-config.local.yaml",
17+
"build-static": "node --loader ts-node/esm src/backend/app.ts build-static -c docs-config.yaml -c docs-config.local.yaml",
1818
"start-backend": "cross-env NODE_ENV=development npx nodemon --config nodemon.json src/backend/app.ts -c docs-config.yaml -c docs-config.local.yaml",
1919
"build-backend": "tsc && copyfiles -u 3 ./src/**/*.twig ./dist/backend/views && copyfiles -u 1 ./src/**/*.svg ./dist/",
2020
"build-frontend": "webpack --mode=production",

0 commit comments

Comments
 (0)