nx-plugins icon indicating copy to clipboard operation
nx-plugins copied to clipboard

[esbuild-plugin-copy] Feature request: Ability to ignore specific files

Open jerrychan7 opened this issue 1 year ago • 1 comments

Thanks for the plugin!

Is it possible to copy all files in the source directory but exclude specific files? I can think of two possible methods:

{
  from: ["./src/**/*", "./imgs/**/*"],
  to: ["./build"],
  // method 1
  ignore: ["*.ts", "*.gif"],
  // method 2
  filter: (filePath) => !filePath.endsWith(".ts") && !filePath.endsWith(".gif"),
}

Or users can be allowed to mix the two methods to achieve more fine-grained control.

jerrychan7 avatar Aug 24 '24 19:08 jerrychan7

This can be achieved with globbyOptions.ignore.

Having an ignore filter function per assets[] can be very helpful with filtering still.

sidvishnoi avatar Jul 04 '25 10:07 sidvishnoi