-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Support multiple entry points #54
Comments
If they resolve to the same configuration, why?
Interesting, I'm not sure when you could need that. I've been using the Webpack context to resolve the
As above. |
Globals, I think. If they shared an instance any ambient declarations would be available for both which might not actually be the case at runtime. Also there's the case where they don't share the same configuration 😄 but, as you said...
I'm not entirely sure either, but my gut is that "it could happen". Take the following case:
For sure it's conceivable that the tsconfig.json files could contain different
This is how ts-loader works right now. BTW, this got on my list because we do something very similar at AssureSign. We have multiple independent "apps" that share a common webpack config but not tsconfig. Right now our build process just runs webpack over and over again changing the entrypoint, but it would be nice if we could just use multiple entrypoints instead and I wasn't quite sure if/how that would work. |
We have a similar setup where I am. That is to say a single webpack config and a number of "apps" (in reality compartmentalised pieces of functionality that make up part of a larger app). Each of these apps has a single to share the relevant bit of our
All of which is a very long way of saying: ts-loader seems to support this already. At least for my own use cases.
I have a shared
Again I'm not sure I'd ever use this. I can't think of a situation which would demand it. |
Actually, ts-loader does not support this fully. It sometimes works, sometimes it doesn't. I also use two entry points, each for a separate client app that has its own .tsconfig inside. The two are dependencies of the main module that holds the webpack config:
The problem arises when you have different modules inside of them. It sometimes happens that it doesn't read both projects .d.ts files before trying to compile, so it throws a lot of "unknown module" errors for one of the entry points. Sometimes, it works. Not sure what's happening there, but I'm guessing that separate instances of ts service would fix that. |
I have two entries: browser and service worker. Each have their own folder with a When I try to use ts-loader with this setup, it seems that one
If I run |
@OliverJAsh last time I checked, ts-loader didn't support multiple tsc instances, not sure if anything changed. I switched to at-loader because of that a year ago, and used the
You need to do this twice, once for each of your entry points. It runs a separate instance of tsc for each entry point. |
@dbettini the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
Webpack allows defining multiple entry points, eg:
I'm not entirely sure what the desired behavior should be here but some possible topics of discussion.
The text was updated successfully, but these errors were encountered: