typescript-transform-paths icon indicating copy to clipboard operation
typescript-transform-paths copied to clipboard

Does not work with relative path to a node module folder.

Open AndrewSouthpaw opened this issue 3 years ago • 0 comments

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? 🤔

AndrewSouthpaw avatar Jun 17 '22 18:06 AndrewSouthpaw