i have two jsconfig.json flie in my project one is for my reactjs and one is for my nodejs project
and it is always good to use special character before the folder path
the config i user for my backend :-
//the config i use for my backend :-
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["*"]
}
}
}
//the config i use for my frontend :-
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"~/*": ["*"]
}
}
}
Looks good but I think tilde-slash prefix (~/) shouldn't be used for project-scoped aliases. ~/ means home directory for current user on unix-like systems. So, it is looking like an absolute path to me at the first glance.
Oh cool, just tried it and it works on Next.js, I remember it has some issue for the F12 look up but I think there is no problem now! Thanks for your addition, updated the blog.
It kinda messes with CRA auto import using that approach, will update if I found anything.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Wasn't this enough? No need to add an entry everytime you create a folder.
i have two jsconfig.json flie in my project one is for my reactjs and one is for my nodejs project
and it is always good to use special character before the folder path
the config i user for my backend :-
Looks good but I think tilde-slash prefix (
~/
) shouldn't be used for project-scoped aliases.~/
means home directory for current user on unix-like systems. So, it is looking like an absolute path to me at the first glance.Oh cool, just tried it and it works on Next.js, I remember it has some issue for the F12 look up but I think there is no problem now! Thanks for your addition, updated the blog.
It kinda messes with CRA auto import using that approach, will update if I found anything.