Skip to content

Instantly share code, notes, and snippets.

@jacrys
Last active December 6, 2023 17:55
Show Gist options
  • Save jacrys/0113190680f164189c482c9d4051204d to your computer and use it in GitHub Desktop.
Save jacrys/0113190680f164189c482c9d4051204d to your computer and use it in GitHub Desktop.
RegEx to clean up un-needed data from vite output logs
(^[0-9\s]*\||^\s*(Plugin|File|at))[\w\d\s\^:",\/.\{\};\-@_\(\)<>='$]*\s*\n //Capture traces and meta data
//Replace with ""
^([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} (A|P)M\s*\[vite\]\s*[A-Za-z\-\s:]*")([A-Za-z\-@\/\._]*)(" from "[A-Za-z\\\.0-9"_\s?\(\)]*)$ //Capture all but failing imports
//Replace with $3 (or /3 depending on regex parser) to extract just the failing imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment