Skip to content

Commit

Permalink
Add compression for .wasm and .cjs files by default
Browse files Browse the repository at this point in the history
Closes #19
  • Loading branch information
kryops committed Apr 2, 2022
1 parent cbd07b7 commit 946e864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function gzipPlugin(explicitOptions: GzipPluginOptions = {}): Plugin {

const options: Required<GzipPluginOptions> = {
// 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),
Expand Down

0 comments on commit 946e864

Please sign in to comment.