Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[npm-url]: https://www.npmjs.com/package/rollup-plugin-output-size
[ci-img]: https://github.com/Arnesfield/rollup-plugin-output-size/workflows/Node.js%20CI/badge.svg
[ci-url]: https://github.com/Arnesfield/rollup-plugin-output-size/actions?query=workflow%3A"Node.js+CI"
[preview-img]: https://gist.githubusercontent.com/Arnesfield/0f85b2ddfa1109aec6ed2ec46ee42b03/raw/99ab51e40bc68145e70e04903ebb6b24c0051ccb/preview.png
[preview-img]: https://gist.githubusercontent.com/Arnesfield/0f85b2ddfa1109aec6ed2ec46ee42b03/raw/7cc3b49fc8496cc71db41a0f273871636520a611/preview.png

# rollup-plugin-output-size

Expand Down Expand Up @@ -47,12 +47,19 @@ export default {

You can change and override the behavior of this plugin through its options. Note that all options are optional.

### bytes

Type: `boolean`<br>
Default: `false`

Displays the byte size instead of the human-readable size for both the output info and [`summary`](#summary) output.

### hide

Type: `boolean | OutputType[]`<br>
Default: `false`

Disable output types display.
Disables output types display.

Set to `true` to disable output for all output types, or set an array to specify which output types will not be displayed.

Expand All @@ -67,7 +74,7 @@ This option does not affect [`summary`](#summary) output.
Type: `boolean | OutputType[]`<br>
Default: `true`

Get gzipped sizes of output.
Gets gzipped sizes of output.

Set to `false` to skip getting gzipped size, or set an array to only get gzipped sizes of specified output types.

Expand All @@ -76,14 +83,14 @@ Set to `false` to skip getting gzipped size, or set an array to only get gzipped
Type: `boolean`<br>
Default: `false`

Disable output. This will also skip the [`handle`](#handle) and [`summary`](#summary) callbacks.
Disables output. This will also skip the [`handle`](#handle) and [`summary`](#summary) callbacks.

### summary

Type: `boolean | 'always' | SummaryCallback`<br>
Default: `true`

Display summary output.
Displays summary output.

- Set to `false` to disable summary output.
- Set to `'always'` to force summary output even if there is only one (1) output.
Expand All @@ -99,7 +106,7 @@ Display summary output.

Type: `(info: OutputInfo, output: OutputAsset | OutputChunk) => void | Promise<void>`

Override the default logging of output info.
Overrides the default logging of output info.

The second argument `output` is the current Rollup output asset or chunk to log, while the first argument is the `OutputInfo`.

Expand All @@ -111,9 +118,9 @@ This package also includes some utility functions that you may find helpful, esp

### format

Type: `(info: OutputInfo) => string`
Type: `(info: OutputInfo, options?: Pick<Options, "bytes">) => string`

Used to get the default display format of output info.
Gets the default display format of output info.

```javascript
import outputSize, { format } from 'rollup-plugin-output-size';
Expand All @@ -139,7 +146,7 @@ export default {

Type: `(input: string | Uint8Array) => Promise<Size>`

Used to get the gzipped size of input.
Gets the gzipped size of input.

```javascript
import outputSize, { gzip } from 'rollup-plugin-output-size';
Expand All @@ -162,9 +169,9 @@ export default {

### summarize

Type: `(summary: Summary) => string`
Type: `(summary: Summary, options?: Pick<Options, "bytes">) => string`

Used to get the default display format of summary info.
Gets the default display format of summary info.

```javascript
import outputSize, { summarize } from 'rollup-plugin-output-size';
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default tseslint.config(
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-require-imports': 'warn',
'@typescript-eslint/no-unused-expressions': [
'warn',
Expand All @@ -33,7 +33,7 @@ export default tseslint.config(
'warn',
{ argsIgnorePattern: '^_' }
],
curly: 'warn',
curly: ['warn', 'multi-line'],
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'no-constant-condition': 'warn',
'no-empty': 'warn',
Expand Down
Loading