#custom paths

12 messages · Page 1 of 1 (latest)

white forge
#

I'm trying to create custom paths in my tsconfig.json. You can see the project structure in the image below. I want to setup 2 paths for the start: "@shared/" and "@/" where @/ is backend/src. and @shared/ is the shared folder. The @shared/ path already works, but I somehow can't get the @/ path to working.

tsconfig.json: https://hastebin.com/share/azuvibacen.json

package.json:
https://hastebin.com/share/opexakeqid.swift

wicked dune
#

!*:paths-are-not-magic

worldly troutBOT
#
T6#2591
`!t6:paths-are-not-magic`:

The paths and baseUrl compiler options don't cause any remapping of imports paths, they only inform TS of existing mappings, which you'll have to setup with some other tool.

baseUrl is a pretty well-supported option (e.g. using the NODE_PATH environment variable with node or resolve.modules with webpack).
paths can be trickier to setup, (especially with node see this for node), and you may find it to not be worth the effort.

wicked dune
#

@white forge It kind of sounds like you're looking for project-references here.

jaunty vigil
indigo pelican
#

Tagged the wrong person @jaunty vigil

jaunty vigil
#

@indigo pelican, sorry bro. Your nicks are so similar)

#

@white forge 👆

indigo pelican
#

you tagged me again 😦

#

no worries! I hope you resolve your problem just be a bit careful when tagging the other Manu 😂

white forge
#

I'm the real one