-
Notifications
You must be signed in to change notification settings - Fork 5
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
ADR: Configuration of import aliases in Javascript applications #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to throw my best counterargument at these ADRs. I can't think of one for this ADR. This ADR is rock-solid advice.
It seems that CRA didn't take into consideration that the following package could exist https://www.npmjs.com/package/src since https://github.com/facebook/create-react-app/blob/8bf050aa7c16078fed5e51ac8388d6100c29e105/packages/react-scripts/config/modules.js#L76 |
Moved the ADR to Reviewing |
I found a decent workaround for CRA which I think satisfies the spirit of this ADR. The problem is CRA doesn't allow you to define path aliases. However, we are able to define a baseUrl in our We can use the baseUrl to achieve the goal of importing our application files like the following example
CRA sets up the directory structure for you and requires that you have a directory named We can satisfy these requirements with minimal changes to the generated directory structure and The resulting directory structure would be as follows
and our
|
No description provided.