DEV Community

Discussion on: No More ../../../ Import in React

Collapse
 
spock123 profile image
Lars Rye Jeppesen

Or use Typescript and use alias there.... React with JS is suck a mess

Collapse
 
vrushank profile image
vrushank

How do you setup alias using typescript? I'm having hard times setting up alias with typescript, It automatically overrides tsconfig settings when we run the project again and jsconfig won't work with typescript.

Collapse
 
spock123 profile image
Lars Rye Jeppesen

Sorry I don't use jsconfig at all, we use pure TSC (Typescript) compiler and we don't use Babel for our projects.

For pure typescript it's just a configuration in tsconfig.json as you mentioned. I am not sure what's going on with your setup, unfortunately
Cheers

Thread Thread
 
vrushank profile image
vrushank

I understand, I just want to know that setting how you setup alias using tsconfig in CRA.

Thread Thread
 
spock123 profile image
Lars Rye Jeppesen

I'm sorry I misunderstood you.
We're not using React so I can't say how it's done there, unfortunately. So sorry

Some comments have been hidden by the post's author - find out more