rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Feature]: CopyRspackPlugin 如何实现 copy-webpack-plugin 的 transform 方法

Open lucasllin opened this issue 1 year ago • 2 comments

What problem does this feature solve?

目前CopyRspackPlugin没有支持transform方法,请问有相关的安排吗

What does the proposed API of configuration look like?

type transform = | { transformer: (input: string, absoluteFilename: string) => string | Buffer; cache?: boolean | TransformerCacheObject | undefined; } | ((input: string, absoluteFilename: string) => string | Buffer);

lucasllin avatar Feb 23 '24 06:02 lucasllin

Because that's function type, previously we have lots of function type APIs not implemented, if you are willing to contribute, you can refer to a similar API, splitChunks.chunks here https://github.com/web-infra-dev/rspack/blob/c7024196b5f4f394d2294a093cbb52c3d200f848/crates/rspack_binding_options/src/options/raw_split_chunks/raw_split_chunk_chunks.rs#L23. But using js function will slow down the build

JSerFeng avatar Feb 28 '24 07:02 JSerFeng

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar May 07 '24 15:05 stale[bot]

Supported in https://github.com/web-infra-dev/rspack/pull/6375

chenjiahan avatar May 17 '24 05:05 chenjiahan