From 946e864b8b6f86e8abbb157de7773457bdb4e278 Mon Sep 17 00:00:00 2001 From: Michael Strobel Date: Sat, 2 Apr 2022 10:31:10 +0200 Subject: [PATCH] Add compression for .wasm and .cjs files by default Closes #19 --- README.md | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c6bb384..4b962ec 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ rollup({ Control which of the output files to compress. -Defaults to `/\.(js|mjs|json|css|html)$/` +Defaults to `/\.(js|mjs|cjs|json|css|html|wasm)$/` **gzipOptions** `object` diff --git a/src/index.ts b/src/index.ts index 0902e43..9f2e8ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -158,7 +158,7 @@ function gzipPlugin(explicitOptions: GzipPluginOptions = {}): Plugin { const options: Required = { // default options - filter: /\.(js|mjs|json|css|html)$/, + filter: /\.(js|mjs|cjs|json|css|html|wasm)$/, fileName: '.gz', customCompression: (fileContent: string | Buffer) => gzipPromise(fileContent, options.gzipOptions),