Closed daphnesmit closed 1 year ago
I am not exactly sure if this is a swc-plugin issue or something else conflicting.
Rather something else in your Rollup Config....
Looking at the resulting code it seems the macro was not expanded by plugin, and imports were deleted by something else. Typescript for example could delete imports because it encounters that actual import {Trans} from "@lingui/macro"
pointing to declaration only.
Looking at your config i don't understand why you need both typescript and swc. Use just SWC without a typescript.
Ah yeah. That was it! sorry!
I am using rollup to build a react package in ts with lingui macros.
When building with latest version of swc-plugin it is removing the Trans imports from the file but never putting them pack from @lingui/react.
looking at this file that should happen? https://github.com/lingui/swc-plugin/blob/3a4b3b2f430052c8a5df7aebe2fa4effeec0010d/src/lib.rs#L176
Resulting in that when I import the package its saying "Trans is undefined"
Here are my files:
Build result example using Trans:
build result using t
String
:Rollup config:
I am not exactly sure if this is a swc-plugin issue or something else conflicting.