Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active January 28, 2025 16:21
Show Gist options
  • Save cecilemuller/fcfe7b09764ca40fa435b540e59d9a76 to your computer and use it in GitHub Desktop.
Save cecilemuller/fcfe7b09764ca40fa435b540e59d9a76 to your computer and use it in GitHub Desktop.

Revisions

  1. cecilemuller revised this gist Jan 28, 2025. No changes.
  2. cecilemuller created this gist Jan 28, 2025.
    13 changes: 13 additions & 0 deletions plugin.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import type { PluginOption } from "vite";
    import { format } from "prettier";

    export function plugin(): PluginOption {
    return {
    name: "example",
    transformIndexHtml: async (html) => format(html, {
    // https://prettier.io/docs/en/options.html
    parser: "html",
    htmlWhitespaceSensitivity: "ignore"
    })
    };
    }