typescript-transform-paths
typescript-transform-paths copied to clipboard
Does not work with relative path to a node module folder.
For various reasons, I had a TS path that reached deeply into an npm package:
paths: {
"@foobar/*": ["./node_modules/eslint/lib/rules/*"]
}
I'd have an import like this:
import { thing } from '@foobar/curly'
Which I would expect to be translated to something like:
const { thing } = require('../../node_modules/eslint/lib/rules/curly')
But instead the transformed output would stop at the index of the node module:
const { thing } = require('../../node_modules/eslint')
Any ideas what's going on here? Is that a bug or expected behavior? Or am I just using the package wrong? 🤔