The reason that keeps breaking is we're using a pretty unsafe operation to delete code based on swc node's span as it's already not recommended, which is only for getting rid of the roll warnings.
Since we are using rollup's built-in parse API, the node span is now safe and correct.
Re-land rollup parse API.
Since we are using rollup's built-in
parse
API, the node span is now safe and correct.I will also send another PR to
bunchee
to fix https://github.com/huozhi/rollup-plugin-swc-preserve-directives/pull/4#issuecomment-1706551223.