browserify / browserify/module-deps
post transform file cache
- Dominant language
- JavaScript
- Stars
- 208
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
Hi folks, I have some tooling built on top of module-deps. Often I already have post transformed source and deps tree information ready to go. It looks like if I provide `opts.cache` it skips reading/parsing source and applying transforms. However, it's unclear to me what the format of a "file object" looks like. Poking through the `walk()` function it looks like I need at least `source`, `package`, and `deps`, so would the format be something like this?
``` js
opts.cache = {
'/User/me/foo.js': {
source: (post transformed source code),
package: ?,
deps: {
'./fooDep1': '/User/me/fooDep1.js',
'../fooDep2': '/User/fooDep2.js'
}
}
};
```
My two questions are:
- I see the transform stream emits other fields too (`file`, `id`, `entry`, etc.) but are those needed in the cache?
- What should the value of `package` field be?
- Any gotchas when it comes to providing cache for files in node_modules?
I'll start running my own tests and exploring, but any guidance would be appreciated. Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.