Skip to content
Discussion options

You must be logged in to vote

if you need some work with ast you need parser hooks.

Now I have the flatter array, But I could't take the array to tree. Can anybody help me?

you should use module graph for that. something like

for (const [ name, { dependencies: deps}] of compilation.entries) {
  const dep = deps[deps.length - 1];
  const module = compilation.moduleGraph.getModule(dep);
  const connections = compilation.moduleGraph.getOutgoingConnections(module);
  // visit modules in connections
}

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@yangguansen
Comment options

@yangguansen
Comment options

@yangguansen
Comment options

@yangguansen
Comment options

@yangguansen
Comment options

Answer selected by yangguansen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #15492 on March 09, 2022 06:02.