diff --git a/src/plugin.ts b/src/plugin.ts index c47a1c0..8ab6a45 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -67,6 +67,10 @@ type PluginOptions = { * optionally `clean-css`. */ minifyHtml?: HtmlMinifyOptions | true + /** + * Suffix to add to compressed file instead of overwriting. + */ + outputSuffix?: string } const mtimeCache = new Map() @@ -274,6 +278,7 @@ export default (opts: PluginOptions = {}): Plugin[] => { await fsp.unlink(filePath) name = path.relative(outRoot, (filePath = newFilePath)) } + filePath += opts.outputSuffix || '' await fsp.writeFile(filePath, content) compressed.set(name, 1 - content.byteLength / oldSize) }