Skip to content

[Feature]: expose ChunkGraph.getBlocks #12416

@hardfist

Description

@hardfist

What problem does this feature solve?

In webpack we can access blocks of chunkgroup by chunkgroup.blocksIterable which is useful to analyze the issue module of async chunks, we need similar api like webpack

What does the proposed API of configuration look like?

Rspack doesn't store blocks in entryGroup directly and store it in chunkGraph and consider webpack also planed to move blocks from chunkGroup to ChunkGraph so we can just expose getBlocks in ChunkGraph

impl ChunkGraph{
  #[napi]
  fn getBlocks(cg: ChunkGroup) -> Vec<Blocks> {
         let compilation = self.as_ref()?;
         // search blocks in compilation.chunk_graph.block_to_chunk_group_ukey
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    teamThe issue/pr is created by the member of Rspack.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions