Skip to content

Conversation

@edisile
Copy link
Contributor

@edisile edisile commented Dec 4, 2025

Done

  • replaced grep command with ripgrep (pulled using @lvce-editor/ripgrep) for cross-platform support
  • improved vite_import detection plugin
  • moved the plugin to a separate file
    • at some point it could also be moved to a separate package

Testing

  • This PR has tests
  • No testing required (explain why): if tests pass it's good

@webteam-app
Copy link

Copy link
Contributor

@alvaromateo alvaromateo left a comment

Choose a reason for hiding this comment

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

Just a concern regarding support for Windows and new line characters.


// the string has multiple lines, some of which might be blank, so split
// on newlines and filter out the empty strings
const imports = viteImports.split("\n").filter(Boolean);
Copy link
Contributor

Choose a reason for hiding this comment

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

In the captureString you consider support for Windows platform (brave 😂).
I believe Windows uses a different new line characters. Won't that be a problem here (and later in the .join("\n"))?

Copy link
Contributor Author

@edisile edisile Dec 5, 2025

Choose a reason for hiding this comment

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

Good point, splitting this way leaves a bad "\r" in the filename... Vite doesn't seem to mind but I'll add a check for this edge case. No need for "\r\n" in the .join call because that only gets printed in the console

Copy link
Contributor

@steverydz steverydz left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@edisile
Copy link
Contributor Author

edisile commented Dec 9, 2025

There are some connection time out issues when downloading ripgrep from github that can lead to builds failing. Adding "don't merge" label until I find some time to investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants