In parcel 1, I was able to import with tilde (~) which usually refers to the nearest directory or the root directory of the project. But, I recently upgraded to parcel 2 and it's complaining. How do I enable the ~ path resolvers in a typescript/react repo ? Do I need to write a resolver for that or is there any build-in support ? Is there any example for this setup ?
How does import with tilde (~) work in parcel-2?
1.6k views Asked by jayzenoceanic At
3
There are 3 answers
0
On
I'm afraid currently that can't be done (July 2022, parcel v2.6.2) even though the official docs say you can. I followed the docs, it didn't work. VS Code respects my tsconfig and resolves tilde imports as expected but the parcel command complains in the terminal.
It looks like a known issue (and another related issue)
Solution?
There's a plugin (parcel-resolver-tspaths) that supposedly solves this issue but I haven't tried it yet.
See also a short blog post about this issue
works fine here. this is my package.json