kryops/rollup-plugin-gzip

Option for custom destination

peopledrivemecrazy opened this issue · 1 comments

It would be great to have another option for choosing anoter destination than the source directory.

I'm very sorry, I must have totally overlooked this issue!

Should this not already be possible through passing a function as fileName option?

gzipPlugin({
    fileName: name => `compressed/${name}.gz`,
}),

When specifying additionalFiles, there might be some kind of switch necessary as their name will be relative to the root directory while rollup's bundle file names will be relative to the target directory:

gzipPlugin({
    additionalFiles: ['dist/foo.css'],
    fileName: name =>
        name.startsWith('dist')
            ? `dist/compressed/${path.basename(name)}.gz`
            : `compressed/${name}.gz`,
}),