Skip to content

[Bug]: CopyRspackPlugin.pattern.from not support to specify a file path not regexp #8056

@moonlitusun

Description

@moonlitusun

System Info

Mac os

Details

There appears to be a bug in Rspack's CopyPlugin where it does not properly handle patterns that specify a single file. This functionality is supported in webpack's CopyWebpackPlugin, but it seems to be missing or not working as expected in Rspack.

Reproduce link

No response

Reproduce Steps

  1. Configure CopyPlugin in Rspack config
  2. Attempt to copy a specific file using a pattern
{
  from: '/xx/xx.ts'
}

But /xx/xx.ts* is working

Expected Behavior:
The plugin should be able to copy a single, specific file when the pattern points to that file.

Actual Behavior:
The plugin fails to copy the file or throws an error (please specify the exact behavior you're seeing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending triageThe issue/PR is currently untouched.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions