-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alias is not resolved based on baseUrl setting on tsconfig.paths.json #10
Comments
Got the same problem |
I'm running into the same issue! @oklas, any intel, so far? |
@MassMessage provided some additional information in #69 |
Thanks to all for sharing info about this question |
The In the main solution, the task is to add aliases next to the src folder. In order to keep this solution not so complicated The point of setting And if we need aliases for all folders inside Currently problem may be solved using |
The state of issue "work in progress" and not yet mentioned in docs yet and typescript is not supported yet. |
🎉 This issue has been resolved in version react-app-alias-ex-v2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version react-app-alias-v2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Released in |
For some background, in my company we use aliases to import shared folders outside of the app folder (imports outside of
src/
). We did this by using symlinks of the outside folders and placed them inside thesrc/
folder of each app that consumed the alias.This library helped the need to create symlinks as well as made adding a new folder slightly easier to do by changing fewer configs.
However, an issue we found was that we were using
baseUrl: 'src'
(the default in create-react-app). This library apparently requires to usebaseUrl: '.'
, so we had to change our aliases in the tsconfig.paths.json respectively.This is a small change for smaller codebases that weren't using imports like
import X from 'components/X';
, since the change ofbaseUrl
broke those imports.I believe that supporting
baseUrl
should be an easy enough change, but wanted to know if this was intentional.In summary:
compilerOptions.baseUrl
is being ignored by the library, and requires it to be'.'
or otherwise the compiler will fail to resolve aliases.Using the following config causes an error when importing the alias.
The text was updated successfully, but these errors were encountered: