I'm building a package and I wanted to build tests only if a certain function of the same local package is called. I don't want to get too much into the details but I am traversing the code with a Babel plugin to look for a specific module import to perform some actions.
The problem is that when I import this function I use locale paths, like this:
import { myFunction } from './';
I would like instead to have something like:
import { myFunction } from 'my-real-package-name';
I tried to install my package locally but now I am getting this error when trying to build:
error TS5055: Cannot write file '/my-real-package-name/lib/index.d.ts' because it would overwrite input file.
I could always check if the import is from ./ or my-real-package-name but I would prefer to just use my-real-package-name since it's safer to avoid unexpected issue.
Is there another way to achieve this?