@drupflare/spool - v0.1.0
    Preparing search index...

    Function buildTrimManifest

    • Trims every stylesheet against the union of the tokens of all pages and all scripts, so one file keeps one URL for the whole site. A stylesheet that loses no rule gets no entry. pages is HTML, scripts the same-origin JavaScript the pages load, styles the same-origin CSS.

      foreignScripts are scripts from other origins that the pages load, such as a widget that builds markup. Their words widen the tokens, because a class such a script adds is in the DOM whatever origin served it. The guard never looks at their URLs, so a vendor that starts adding a new class after the crawl is not caught.

      Parameters

      • input: {
            foreignScripts?: readonly TrimFile[];
            pages: readonly string[];
            scripts: readonly TrimFile[];
            styles: readonly TrimFile[];
        }

      Returns Promise<TrimManifest>