Skip to content
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

Fix: Update swc and plugin to prevent error of swc configuration #278

Merged
merged 8 commits into from
Oct 21, 2023

Conversation

kdy1
Copy link
Contributor

@kdy1 kdy1 commented Oct 21, 2023

I found that patching @swc/core (in node_modules) as

const cleanUndefined = object => JSON.parse(JSON.stringify(object));

exports.printSync = printSync;
async function transform(src, options) {
    options = cleanUndefined(options);
    if (options.jsc.parser.syntax ==='typescript'){
        delete options.jsc.parser.jsx
    }
    console.log(options)
    return compiler.transform(src, options);
}

almost works, so I made SukkaW/rollup-plugin-swc#54

@kdy1 kdy1 marked this pull request as ready for review October 21, 2023 13:25
Copy link
Owner

@huozhi huozhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@huozhi huozhi changed the title chore: Update swc Fix: Update swc and plugin to prevent error of swc configuration Oct 21, 2023
@huozhi huozhi merged commit c70ab29 into huozhi:main Oct 21, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants