-
-
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
Re-exported const enums break emit in watch mode #376
Comments
Thanks for the issue and the PR illustrating the issue. I think you're right - it's a problem. If you get the time to take a look at this that'd be awesome. I'm not sure when I'd get time to look myself. |
I can probably at least play around with this. |
Awesome - every little helps 😉 |
johnnyreilly
added a commit
that referenced
this issue
Nov 18, 2016
Add test for handling re-exported const enums (issue #376)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given
bar.ts:
foo.ts:
app.ts:
the emit for app.ts in the initial build looks like the following:
After changing bar.ts to
no modules will be rebuild. The expected output after the change would be
This is because ts-loader currently only adds the direct dependencies of modules as dependencies to webpack. Because bar.ts is not a direct dependency of app.ts, app.ts will not be rebuild when bar.ts changes.
For semantic errors the deeper dependencies are handled in the after-compile hook, but this doesn't help in cases like const enums where the actual emit can depend on deeper dependencies.
I believe awesome-typescript-loader does add all actual dependencies of a module as webpack dependencies recursively, which I think is the only way to handle these (relatively rare) cases correctly.
I'll post a pull-request with a test showcasing this error.
The text was updated successfully, but these errors were encountered: