Skip to content

Conversation

jesstelford
Copy link
Contributor

@jesstelford jesstelford commented Feb 16, 2017

By not passing back any fileData, we trigger module-dep's readFile function, which in turn emits the 'file' event that is required by watchify to correctly trigger an 'update' event, allowing us to rebuild.

(This was a doozy of digging through events to figure out!)

By triggering `module-dep`'s `readFile` function, the `'file'` event is emitted, which is required by watchify to correctly rebuild.
@jesstelford
Copy link
Contributor Author

Actually, on further thought - does this actually achieve anything? Using watchify means that rebuilds are very fast due to a different caching mechanism used internally. And given this change forces rebuilding on every run, it wouldn't be useful as a cache across runs (or across modules that share the same cache key object).

Thoughts?

@martinheidegger
Copy link
Owner

martinheidegger commented Feb 16, 2017

Oh my...

the first thought that comes to mind is that watchify should use the new cache API ;). This PR though destroys all the value we get from the fs cache and I think we have to take a different approach to fix that.

@martinheidegger
Copy link
Owner

This is actually an issue in module-deps. I am preparing a PR to fix it.

@martinheidegger
Copy link
Owner

In case you didn't see it: I opened browserify/module-deps#127 that should fix this issue. It would be lovely if you could review/test it.

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.

2 participants