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

perf: check if js needs compilation #365

Merged
merged 76 commits into from
Nov 9, 2023
Merged

Conversation

privatenumber
Copy link
Owner

@privatenumber privatenumber commented Nov 6, 2023

fix #167
fix #228

At first, I aimed to exclude all node_modules in CommonJS's require hook. However, due to the project's goal of converting packages using ESM syntax (import/export) without a Module type to CommonJS syntax (require()), it's not possible to completely ignore node_modules. Nevertheless, I incorporated checks for ESM syntax to prevent unnecessary file compilation to enhance performance. This should also dramatically reduce the __name not found errors in dependencies.

Furthermore, I removed high-resolution source map generation in MagicString due to its time-consuming nature. Even the non-high-resolution version is somewhat slow but I'm not sure if anything can be done here (is there such thing as partial source maps?).

@privatenumber privatenumber marked this pull request as ready for review November 6, 2023 06:45
Base automatically changed from refactor-tests to next November 8, 2023 09:11
@privatenumber privatenumber merged commit 89cb240 into next Nov 9, 2023
2 checks passed
@privatenumber privatenumber deleted the cjs-compile-esm-check branch November 9, 2023 02:46
privatenumber added a commit that referenced this pull request Nov 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant