Skip to content

Splitchunks.chunks supports regex #17330

@hardfist

Description

@hardfist

Feature request

What is the expected behavior?
splitChunks.chunks supports regex to match agains chunk.name

module.exports = {
   optimizations: {
     splitChunks:{ 
         chunks: /antd/
     }
  }
}

What is motivation or use case for adding/changing the behavior?
function call cost is much higher than regex(because function involves napi communication and we can implement regex in rust side) in rspack and the call frequency of splitChunks.chunks is very high, so if webpack could support regex here then rspack could align this with webpack.
How should this be implemented in your opinion?
use chunk.name to match regex
Are you willing to work on this yourself?
yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions