plugins icon indicating copy to clipboard operation
plugins copied to clipboard

feat(swc): sets filename property, so to make additional swc features…

Open klassm opened this issue 1 year ago • 1 comments

Rollup Plugin Name: swc

This PR contains:

  • [ ] bugfix
  • [x] feature
  • [ ] refactor
  • [ ] documentation
  • [ ] other

Are tests included?

  • [ ] yes (bugfixes and features will not be merged without tests)
  • [x] no

Breaking Changes?

  • [ ] yes (breaking changes will not be merged unless absolutely necessary)
  • [x] no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

Background: When using the swc rollup plugin in vitest, debugging will not work. I assume this comes from the filename property not being set, as the documentation states:

The filename is optional, but not all of Swc's
functionality is available when the filename is unknown, because a subset of options rely on the filename for their functionality.

Setting a filename should not have any side effects, just make debugging and other features work.

klassm avatar Aug 27 '24 11:08 klassm

If someone has a hint on how to test that, I would also add a test. I've looked at the existing tests, but both file and sourceMap seem to be exactly the same after the change.

klassm avatar Aug 27 '24 12:08 klassm

LGTM

tada5hi avatar Sep 03 '24 14:09 tada5hi