isaacs / tshy

Other
890 stars 18 forks source link

add a config to suppress the self-dep link #5

Closed isaacs closed 1 year ago

isaacs commented 1 year ago

In order to facilitate import { blah } from '@local/package', tshy creates a temporary symlink in ./src/node_modules/<name> and a persistent symlink in dist/node_modules/<name>, pointing to the cwd, if the package has a name.

It's clever enough to not do that if it's already in a node_modules folder by its package name, or linked to from some parent node_modules folder.

But, in a workspaces setup, this can still cause problems if you have a vendored/generated package inside a workspace like this, requiring some hacky workarounds

It'd be better if you could just do:

{
  "tshy": {
    "selfDep": false
  }
}

to suppress the self-dependency link behavior entirely, and save the checks.