After switching from CommonJS to esnext module, import of other .ts files from .ts file is no longer possible.
My getButton.ts imports this:
import { Button } from "../../../objects/Button";
ts.config:
{
"extends": "..",
"compilerOptions": {
"module": "esnext",
"types": [
....
],
"target": "esnext"
},
}
package.json has:
"type": "module"
So now when I try to run this, I get:
Error: Cannot find module /../../Button
...
at ESMLoader.resolve
When I provide the full path with .ts extension, I get:
An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.
I would like to avoid adding .ts extension to all files, since it cause many other errors to appear, is it possible to solve this by some other way?