You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hiya, first off - thanks for making this plugin! It's super helpful.
I spent the last 12 hours banging my head against the wall trying to figure out how to get this loader to work correctly. All of the types were being generated and I was successfully copying them over to my other services using webpack-remote-types-plugin and tar-webpack-plugin to generate the tgz archives. However, my TSServer could not find the type declarations.
It turns out, the top-level type declaration file that should be a sibling to the dts file in the generated types directory was not being generated. So I added some logging to the code to figure out what was going wrong. I realized that my exposes config looked like this:
Easy enough to workaround, but Module Federation works with the implicit index paths. It would save a lot of future headaches to add some support for implicit paths out of the box (also I generally prefer using the implicit paths because it looks neater).
The text was updated successfully, but these errors were encountered:
I spent some time digging into this a bit. Ideally we'd use Typescript's module resolution logic directly (to avoid re-implementing the resolution logic), but I can't seem to figure out a good way to do this. I'm thinking it might be possible to do this with the typescript object, but A) trying to find documentation for this is proving to be impossible and B) there's a lot of stuff to sift through. Since you've been using the typescript object in the plugin already, you might have some more insight into this :)
I've also tried using node's require.resolve, but that doesn't seem to like the absolute paths we have in emitFile.
If we just put inputFilePath into the resolver function (wherever it may be) on line 119 in emitFile, I think we'd be in business.
const inputFilePath = path.resolve(cwd, value)
if (inputFilePath === fileName) {
Hiya, first off - thanks for making this plugin! It's super helpful.
I spent the last 12 hours banging my head against the wall trying to figure out how to get this loader to work correctly. All of the types were being generated and I was successfully copying them over to my other services using
webpack-remote-types-plugin
andtar-webpack-plugin
to generate the tgz archives. However, my TSServer could not find the type declarations.It turns out, the top-level type declaration file that should be a sibling to the
dts
file in the generated types directory was not being generated. So I added some logging to the code to figure out what was going wrong. I realized that myexposes
config looked like this:while your logic expects explicit module paths like:
Easy enough to workaround, but Module Federation works with the implicit index paths. It would save a lot of future headaches to add some support for implicit paths out of the box (also I generally prefer using the implicit paths because it looks neater).
The text was updated successfully, but these errors were encountered: