-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Hello, thanks for Lingui!
We have a large NestJS project (~5,000 source files) but only ~100 files use Lingui macros on the server side (msg, t from @lingui/core/macro). The @lingui/swc-plugin is configured globally in our .swcrc, so it processes all 5,000 files on every build — even though ~4,900 of them have no Lingui imports at all.
The per-file overhead seem to add up significantly and impact performance
Would it be possible for the plugin to short-circuit early when a file contains no Lingui imports if that's not the case? Maybe an early exit before doing a full AST traversal (if that's what you do), it would make the no-op case near-instant and dramatically improve build times for large codebases where only a small fraction of files use Lingui.
Alternatively, is there a way to configure SWC to apply the plugin only to specific files/directories?
Thanks a lot
Félix