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

feat: source-map using MagicString #46

Closed
wants to merge 2 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Jun 23, 2023

Fixes misalignment of debugger statements etc. when using this plugin, which forced us back to Webpack.


Barely tested due to:

We'll probably migrate to another package which has a proper JS parser (instead of hacky regex), so I'm not sure how much time I'll invest into improving this PR.


const requireMatches = code.matchAll(requireRegex);
const requireMatches = ms.toString().matchAll(requireRegex);
Copy link
Author

Choose a reason for hiding this comment

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

These steps might not work correctly, because the modified string is being returned here, but replacements happen in the original string.

This should probably be improved, but I feel this code needs to be modified anyway (with a proper JS parser instead of regex).

@ghost ghost closed this by deleting the head repository Oct 28, 2024
This pull request was closed.
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.

0 participants