-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add dependent info to metafile #1694
Comments
This info is totally able to be calculated from the metafile, I think you can write a little script to build a dependent graph. |
of course it can be calculated, but it would be better if meta provides this info, and the calculation has come cost for large projects |
It's intentional that redundant information has to be computed. Including all combinations of redundant information forms in the metafile would make it really big and would slow down all builds. Instead, you should use the information in the metafile to compute the information you need.
Here's an example of doing that: const inputsForEntryPoint = {}
for (const output of Object.values(meta.outputs)) {
if (!output.entryPoint) continue
const visited = new Set()
const visit = input => {
if (visited.has(input)) return
visited.add(input)
for (const { path } of meta.inputs[input].imports) visit(path)
}
for (const input in output.inputs) visit(input)
inputsForEntryPoint[output.entryPoint] = [...visited]
}
I tried this on a large project of mine and it only took 10ms to run. Computing this information yourself shouldn't be an issue. Closing since this is by design. |
It seems that metafile doesn't contains dependent(A depends on B, then A is B's dependent, B is A's dependency) information about module, which is hard to use for some scenario.(for example I want to track which entryPoints import specific js file)
The text was updated successfully, but these errors were encountered: