-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts-node should not be default when --import
flag is present
#2157
ts-node should not be default when --import
flag is present
#2157
Comments
Same here, I want to use {
"ext": "ts",
+ "execMap": {
+ "ts": "node"
+ },
"env": {
"NODE_OPTIONS": "--import tsimp/import"
}
}
|
Sorry for the late reply. I've tried to compose multiple replies, and it keeps changing drastically as I start to fully understand the problem (aka: "fully read the ticket"!). Would it make sense to add support for I'm really not sure what the broader impact is, but I'm guessing (because I've not used these myself) that My gut says that since adding the original Just let me know (hopefully with a considered response) and I'll get the change in and released 👍 |
I think that's correct, to support both flags. Usage of You can read more in official Node.js docs: |
I just pushed the code but for some reason it's not deploying, so I'll try to sort that out this evening. |
🎉 This issue has been resolved in version 3.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
That's live |
nodemon -v
: 2.0.20cross-env IS_LOCAL=true \"NODE_OPTIONS=--import ./register-hooks.js\" IS_RUNNING_LOCALLY=true BASEPLATE_ENV=dev PORT=7601 nodemon --signal SIGINT backend/Server.ts --watch backend --watch migrations --watch frontend --watch docs --ext tsx,ts,js,md,mdx,ejs
See related f7816e4 and #2083. In NodeJS 20, it's possible to customize loader hooks via both the
--loader
and--import
flags, but nodemon currently only accounts for the--loader
hookExpected behaviour
When the
--import
NODE_OPTIONS flag is present, ts-node should not be the default program to execute.ts
and.tsx
files.Actual behaviour
When the
--import
NODE_OPTIONS flag is present, ts-node is the default program to execute.ts
and.tsx
files. Note that this can be worked around by creating a nodemon.json file with the following:Steps to reproduce
.register.mjs
file that uses https://github.com/node-loader/node-loader-babel to compile typescript files"NODE_OPTIONS=--import ./register.mjs" nodemon main.ts
Note the error that occurs:
The text was updated successfully, but these errors were encountered: