ts-node
ts-node copied to clipboard
can we get an api to specify the esm loader.
to use esm my package.json looks something like this:
{
"start": "npm run clean && cross-env NODE_ENV=development NODE_OPTIONS=\"--loader=ts-node/esm --trace-warnings\" webpack serve --mode=development --config webpack.config.ts",
}
even though i set esm to be true in ts-config
{
"ts-node": {
"esm": true,
"files": true,
"experimentalSpecifierResolution": "node",
},
}
i dont know why this is necessary. i know i cannot set corresponding loader in any config and had to resort to set it within NODE_OPTIONS.
new to transpilers and the world around it, this was a surprisingly painful experience.
tsx might be better for this case