Skip to content

Watch imports that are not emitted #52

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

Closed
wants to merge 1 commit into from
Closed

Conversation

jbrantly
Copy link
Member

There is a bug where if you use an import that is not emitted that import is not watched by webpack and any updates to it will not be reflected when watching.

This is just a test for the moment for documentation purposes. I'll add a fix at a later date. I've looked at this a little bit already and my current thinking is to use preProcessFile to get a list of imports and adding them as a dependency so that they'll be watched.

@blakeembrey
Copy link
Member

Ah, yes, my solution was a bit jank but I solved it by doing a hack where I kept the current loader around (since it's all synchronous) and added anything to that (https://github.com/blakeembrey/typescript-simple-loader/blob/master/src/typescript-simple-loader.ts#L77-L79).

@jbrantly
Copy link
Member Author

That's really interesting! I would have assumed that getScriptSnapshot would only be called once for any particular version of the file. I'll have to explore that method for sure.

@johnnyreilly
Copy link
Member

Closing as covered by importsWatch test I believe

@johnnyreilly johnnyreilly deleted the watch-imports branch July 13, 2017 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants