UNPKG

vite-plugin-singlefile-compression

Version:

Compress all assets and embeds them into `dist/index.html`, making it convenient to share as a single HTML file.

58 lines (57 loc) 1.69 kB
import { Options as htmlMinifierOptions } from 'html-minifier-terser'; import { compressFormat } from './compress.js'; export interface Options { /** * Rename index.html */ rename?: string; /** * https://github.com/terser/html-minifier-terser?tab=readme-ov-file#options-quick-reference * @default defaultHtmlMinifierTerserOptions */ htmlMinifierTerser?: htmlMinifierOptions | boolean; /** * Try inline html used assets, if inlined or not used in JS. * @default true */ tryInlineHtmlAssets?: boolean; /** * Remove inlined asset files. * @default true */ removeInlinedAssetFiles?: boolean; /** * Try inline html icon, if icon is in public dir. * @default true */ tryInlineHtmlPublicIcon?: boolean; /** * Remove inlined html icon files. * @default true */ removeInlinedPublicIconFiles?: boolean; /** * Use Base128 to encode gzipped script. * If false, use Base64. * https://www.npmjs.com/package/base128-ascii * @default true */ useBase128?: boolean; /** * Compress format. * @default "deflate-raw" */ compressFormat?: compressFormat; } export declare const defaultHtmlMinifierTerserOptions: htmlMinifierOptions; export interface innerOptions { rename?: string; htmlMinifierTerser: htmlMinifierOptions | false; tryInlineHtmlAssets: boolean; removeInlinedAssetFiles: boolean; tryInlineHtmlPublicIcon: boolean; removeInlinedPublicIconFiles: boolean; useBase128: boolean; compressFormat: compressFormat; } export declare function getInnerOptions(opt?: Options): innerOptions;