Menu

📰
0

Finally, Use Your TypeScript Aliases in Parcel v2

DEV Community: parcel·Zach·about 1 month ago
#kFGuHHZ5
#dev#typescript#class#parcel#aliases#article
Reading 0:00
15s threshold

Do you have a webpack setup you've labored over, but want to try parcel? Blocked on migration because Parcel doesn't resolve tsconfig aliases? Now you can, in the spirit of (almost) zero-config. Just install parcel-resolver-tspaths and follow the instructions. How Parcel is Out-of-the-Box Parcel is supposed to be a fun zero-config build tool. That bubble bursts when you discover that your TypeScript path aliases force you into tooling-specific configuration yet again. If we look at the Parcel docs for module resolution and aliases: Aliases are supported through the alias field in package.json. ... // package.json { "alias" : { "react" : "preact-compat" , "react-dom" : "preact-compat" , "local-module" : "./custom/modules" } } But lets not make a mess of things. Tsconfig aliases don't belong in package.json , especially when you can't easily auto-generate them .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More