Skip to content

Commit 9219e6b

Browse files
CopilotneSpecc
andcommitted
Fix ERR_UNKNOWN_FILE_EXTENSION by configuring ts-node loader for ESM
Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
1 parent f3c72d2 commit 9219e6b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)