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: ignore dynamic import for hasModulesyntax #164

Conversation

sapphi-red
Copy link
Contributor

@sapphi-red sapphi-red commented Nov 10, 2023

I initially included dynamic imports to be detected as hasModuleSyntax = true in #160.
But now I recalled that non-ESM files (e.g. CJS files, <script> tag) can contain dynamic imports.

This PR will make dynamic import to be ignored for hasModulesyntax. Including a dynamic import won't make hasModulesyntax to be true anymore.

Users that wants the previous behavior can achieve with imports.some(i => i.d >= 0) || hasModuleSyntax.

@guybedford
Copy link
Owner

Thanks for catching this and posting the follow-up.

@guybedford guybedford merged commit 2eeee5b into guybedford:main Nov 12, 2023
1 check passed
@sapphi-red sapphi-red deleted the fix/ignore-dynamic-import-for-has-esm-syntax branch November 12, 2023 10:09
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.

None yet

2 participants