not working example:
index.js:
require('file1')
file1.ts:
export default {x:1}
when parsing index.js with this plugin :
require("file1")
working example
index.js:
require('file1')
file1.js:
export default {x:1}
when parsing index.js with this plugin :
require("./file1")
{
"plugins": [
[
"module-resolver",
{
"root": ["./src"]
}
]
]
}
what is the problem with typescript files?
ok, I found the problem:
Why not adding ts,tsx,d.ts files also?
The initial idea was that typescript is not javascript. So you would have to set your own extensions in the plugin options.
Most helpful comment
https://github.com/tleunen/babel-plugin-module-resolver/blob/master/DOCS.md#extensions
Thanks!!!!!!!