-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add both default and named export #5
Conversation
The change is legit but wonder why you have the issue, also saw you’re using |
I don't know, but I guess it is caused by how rollup bundles the
|
Ah looks like the official plugins are using a trick like Which we don't have it, and |
src/index.ts
Outdated
@@ -14,7 +14,7 @@ interface PreserveDirectiveMeta { | |||
directives: Record<string, Set<string>> | |||
} | |||
|
|||
export default function swcPreserveDirectivePlugin(): Plugin { | |||
export function swcPreserveDirective(): Plugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export function swcPreserveDirective(): Plugin { | |
function swcPreserveDirective(): Plugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in adee1ff
(#5).
src/index.ts
Outdated
@@ -103,3 +103,5 @@ export default function swcPreserveDirectivePlugin(): Plugin { | |||
} | |||
} | |||
} | |||
|
|||
export default swcPreserveDirective |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can create a named export with a shorter name just other rollup plugins
export default swcPreserveDirective | |
export default swcPreserveDirective | |
export { swcPreserveDirective as preserveDirective } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in adee1ff
(#5).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The default export breaks
rollup -c rollup.config.ts --configPlugin swc3 --bundleConfigAsCjs
: https://github.com/SukkaW/foxact/actions/runs/5567493053/jobs/10169409656The PR adds both named export and default export.