richardtallent / vite-plugin-singlefile

Vite plugin for inlining JavaScript and CSS resources
MIT License
808 stars 53 forks source link

Trim leading and trailing newlines #91

Open mataha opened 7 months ago

mataha commented 7 months ago

This is a follow-up to #85 - while newlines inserted as a result of inlining assets within the plugin were rid of, trailing EOF whitespace characters within the inlined code persist:

<!doctype html>
<html>
  <head>
    <style>html{box-sizing:border-box;text-size-adjust:none}
</style>
  </head>
  <body>
    Hello World!
  </body>
</html>

(I had to split this PR in order to build the project on Windows without any errors - d4ca753 is the main course, 214fd1b consists of changes to the project itself)