When using remark-shiki-twoslash inside workspace package, it either doesn't resolve dependencies at all or even uses wrong versions. It took me quite some time to debug that remark-shiki-twoslashsets vfsRoot to basically /node_modules/remark-shiki-twoslash/, rather than twoslash`s advertised process.cwd(), which in turn makes TypeScript resolve packages from root rather than current package directory.
The userland fix for this is to set vfsRoot: process.cwd().
But why does it work this way? And can we change it to use the default behaviour?
When using
remark-shiki-twoslash
inside workspace package, it either doesn't resolve dependencies at all or even uses wrong versions. It took me quite some time to debug thatremark-shiki-twoslash
setsvfsRoot
to basically/node_modules/remark-shiki-twoslash/
, rather thantwoslash
`s advertisedprocess.cwd()
, which in turn makes TypeScript resolve packages from root rather than current package directory.The userland fix for this is to set
vfsRoot: process.cwd()
.But why does it work this way? And can we change it to use the default behaviour?
P.S. Thanks for you work!