-
Notifications
You must be signed in to change notification settings - Fork 486
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
Typescript does not solve the modules correctly with dependencies in monorepo #1744
Comments
Not sure if this is helpful, but when I rolled out Typescript in a monorepo I had to use the moduleNameMapper config option to get Jest to be able to resolve the packages, and the analog here would be something like:
Not sure whether this is useful either, but I also note that here we have this in our "tsconfig.json":
but I used:
|
hey @wincent thanks for this, I'll test. Some of the problems we have is that the Typescript loader resolves only to the files declared in compiled
A hack solution would be to change the Another solution is to change the path to point to src and add an
But anyway, we will have issues with VSCode's Intellisense. |
I think the only temporary workaround for this to work fine is always to run |
Yeah the best solution I found was the run the |
That sounds pretty clean; what's the problem with doing it that way? |
hey @wincent I did not want to have to point to the |
Sorry, for some reason I am just seeing this now.
This seems like the best solution to me. I personally prefer "index" for entry points to the module as well, so it seems fine to me. I am actually running into this issue with the storybook demos, I will add a commit with this for testing it out. |
ok, thanks @bryceosterhaus. |
Closing this, since we have resolved this through #1838. |
This bug sounds pretty familiar with what we had when we started building the components of Clay, so I'm going to leave a checklist of things that we should look out for to create an integration and not have any problems ahead. (I wait)
a
package depends on theb
andc
package and thec
package depends on theb
package, we have to be careful that there is no duplication of code.yarn start
command that is running webpack should resolve the packages correctly and point to thetsx
files. (Probably we'll have to make some modifications to make this happen, typescript is trying to solve the package.jsonmain
by pickinglib/ClayXXX
...)main
attribute ofpackage.json
is pointing to files compiled in thelib
folder. (One solution is to modify the attribute to point totsx
files in development environment...)tsx
files of each package.The text was updated successfully, but these errors were encountered: