rollup-plugin-html2
    Preparing search index...

    Interface RollupHTML2PluginOptions

    HTML2 Plugin Options

    interface RollupHTML2PluginOptions {
        entries?: Record<string, Entry>;
        exclude?: string[] | Set<string>;
        externals?: { after?: External[]; before?: External[] };
        favicon?: string;
        fileName?: string;
        inject?: boolean | "body" | "head";
        meta?: Record<string, string>;
        minify?: false | MinifierOptions;
        onlinePath?: string;
        template: string;
        title?: string;
    }
    Index

    Properties

    entries?: Record<string, Entry>

    A set of options for injected records, where key is the name of the generated entry or chunk and value is a set of link or script attributes.

    If not set then only the generated output of the input entries will be inserted without additional attributes.

    If tag of an entry is not set then it will be determined based on other attributes and file extension.

    {
    index: {
    type: 'module',
    },
    }
    exclude?: string[] | Set<string>

    An array or set of names of entries to exclude from injection.

    ['worker']
    
    externals?: { after?: External[]; before?: External[] }

    Arrays of additional scripts and links that will be injected to the output HTML document before or after the generated entries and chunks.

    Tag is mandatory.

    {
    before: [{
    tag: 'link',
    href: 'https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css',
    crossorigin: 'use-credentials',
    }],
    after: [{
    tag: 'style',
    text: `
    body {
    margin: 0;
    height: calc(100vh - 1px);
    display: flex;
    }
    `,
    }, {
    tag: 'script',
    text: 'console.log("Hello from external code!")',
    }],
    }
    favicon?: string

    A file path of the favicon of the output HTML document. The provided file will be emitted as an asset.

    fileName?: string

    A file name of the resulting HTML document.

    ⚠️ Mandatory if the RollupHTML2PluginOptions.template option is set to an HTML.

    path.basename(template)
    
    'index.html'
    
    inject?: boolean | "body" | "head"

    Defines whether to inject bundled files or not. If set to false then bundled files are not injected. If set to "head" or "body" then script tags are injected to the selected element.

    true
    
    meta?: Record<string, string>

    A set of metadata of the output HTML document. The provided object is handled as pairs name: content.

    {
    description: 'Generated with Rollup',
    }
    minify?: false | MinifierOptions

    Options to pass to the html-minifier. If the options is undefined or set to false then the output HTML will not minified.

    {
    removeComments: true,
    collapseWhitespace: true,
    keepClosingSlash: true,
    }
    onlinePath?: string

    A path to append to file references injected. This is useful for putting files on a CDN after building.

    '//www.example.com/foo'
    

    Which will generate:

    <script src="//www.example.com/foo/main.js"></script>
    
    template: string

    A path to an HTML template file or an HTML string.

    'src/index.html'
    
    '<html lang="en"><head><meta charset="utf-8"></head><body></body></html>'
    
    title?: string

    Sets the title of the output HTML document.