Uh oh!
There was an error while loading. Please reload this page.
Set baseUrl from jsconfig.json/tsconfig.json - #6656
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
zheeeng
commented
Mar 16, 2019
cheers, we neeeeeed it! |
Not sure if (or how) the tests on the CI are failing because of my changes 🤔 |
@rovansteen for the tests that failed on install: I think it should fix it. |
robertvansteen
commented
Mar 17, 2019
@eladmotola thanks, that fixed the |
mrmckeb
left a comment
There was a problem hiding this comment.
This is great, @rovansteen. Thanks for your hard work.
I'm happy to approve as it is, but I have a discussion point - limiting to src will affect some other projects and the way some users work with CRA currently.
We can consider using paths as I've suggested, I'm interested in your thoughts here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
iansu
commented
Apr 16, 2019
@rovansteen I've fixed the behavior tests. There are a couple of last minute questions from @mrmckeb and myself and then I think we're ready to merge this. |
robertvansteen
commented
Apr 16, 2019
iansu
commented
Apr 16, 2019
Thanks for everyone's work on this, especially @rovansteen! |
delaaxe
commented
Apr 17, 2019
Congrats! |
robertvansteen
commented
Apr 17, 2019
Thanks for merging this and helping out with the final bits @iansu! 👏🏻 |
mrmckeb
commented
Apr 17, 2019
This works wonderfully, thanks @rovansteen. I think a lot of people are going to be very grateful for your work here! |
iansu
commented
Apr 17, 2019
Now we just need someone to document this before the 3.0 release: #6765 |
g1eny0ung
commented
Apr 19, 2019
@rovansteen Thanks to your jobs. 🎉🎉 |
nasreddineskandrani
commented
Apr 19, 2019
Thanks for the effort. Really Really appreciated add on. |
FezVrasta
commented
Apr 22, 2019
So do we have to import |
robertvansteen
commented
Apr 22, 2019
@FezVrasta setting the For more information check out the documentation. |
@rovansteen How do we import using |
zheeeng
commented
Apr 23, 2019
Can we define more customized path aliases like '@src', '@components', '@config', '~src', '~components', '--utils' which have been supported by Webpack and tsconfig.json many years and widely used? |
robertvansteen
commented
Apr 23, 2019
We are open to adding support for aliases in a future release. But right now it’s limited to baseUrl only. |
ConAntonakos
commented
Apr 23, 2019
Awesome! This would be amazing, and I wonder if it'll be easier with this |
vishal423
commented
Apr 25, 2019
In one of my sample projects, I use |
BANG88
commented
Apr 26, 2019
If you have a |
silltho
commented
Apr 26, 2019
We are facing the same issue, does someone have an idea how to fix this? |
delaaxe
commented
Apr 27, 2019
@silltho Check this comment it worked like a charm for me and others: #5118 (comment) |
This is a partial implementation of #6116. Because there are still a number of things that need to be figured about alias support I think it will be the best approach to add support for
baseUrlfirst.This will be a breaking change and removes support for setting
NODE_PATHin.envfile in favor of settingbaseUrlin eitherjsconfig.jsonortsconfig.json. It adds a warning to the start script to inform the user about this change if there is aNODE_PATHvalue inprocess.env.This PR aims to add the existing behavior of resolving modules with absolute path that already exists in CRA but in a consistent manner for both TypeScript and JavaScript projects.
Since this is a breaking change it would be nice to get this in with 3.0. After that we can create another PR to add support for aliases (like @) since that would be a non-breaking change.