rollup-plugin-swc icon indicating copy to clipboard operation
rollup-plugin-swc copied to clipboard

Version `0.2.0` breaks tsconfig paths

Open narcisbugeag opened this issue 3 years ago • 6 comments

Hey, looks like version 0.2.0 breaks rollup-plugin-tsconfig-paths functionality.

I've made a reproduction code specifically for this issue. LeonardSSH/rollup-plugin-swc-issue

Why do I say it's a version problem?

'Cause downgraded to version 0.1.4, and that works perfectly. I tend to think the problem comes from the commit https://github.com/SukkaW/rollup-plugin-swc/commit/290263aff050afb87888196aa6735e3b90c70055.

Current Behavior

PRIVATE → dist/server.js...

(!) Unresolved dependencies
@shared/constantsts (imported by packages\server\src\index.ts)
created dist/server.js in 71ms

Expected Behavior

PRIVATE → dist/server.js...
created dist/server.js in 57ms

Maybe it's something to do with the way SWC takes baseUrl and paths?

narcisbugeag avatar Jan 31 '22 19:01 narcisbugeag

yes, I came into same problem.

tsPathsPlugin + "rollup-plugin-swc3": "0.1.4", works. But 0.2.0 above not

mzvast avatar Aug 03 '22 16:08 mzvast

@mzvast @leonardssh @giveerr

After speaking to some swc maintainers, I have updated the implementation to pass file id to swc. Would you like to try version 0.4.1 to see if it fixes the issue?

SukkaW avatar Aug 25 '22 12:08 SukkaW

@SukkaW I have made the same changes by my own and it's working. (In my case)

giveerr avatar Aug 25 '22 12:08 giveerr

I have already mentioned this in #15

giveerr avatar Aug 25 '22 12:08 giveerr

I have already mentioned this in #15

And would you mind validating if 0.4.1 fixes the issue?

SukkaW avatar Aug 25 '22 13:08 SukkaW

I have already mentioned this in #15

And would you mind validating if 0.4.1 fixes the issue?

Yes it works.

giveerr avatar Aug 26 '22 00:08 giveerr