Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3b760d4
Update documentation
Arnesfield Apr 21, 2025
9791d68
Add `--configImportAttributesKey` flag to rollup bundle script
Arnesfield Apr 22, 2025
038854c
Update versions in workflow configs
Arnesfield Apr 22, 2025
5d91b51
Remove `strip-ansi` dev dependency, use `util.stripVTControlCharacter…
Arnesfield May 7, 2025
06ad0d0
Update README
Arnesfield May 7, 2025
ad96be5
Update imports for `gzip` util
Arnesfield May 7, 2025
0237f9e
Bundle ESM externals into the CJS build
Arnesfield May 7, 2025
11a6a9b
Update dependencies
Arnesfield May 7, 2025
a49881d
Use `util.styleText()` for log colors
Arnesfield May 30, 2025
513c836
Add and use formatBytes util, update tests
Arnesfield May 30, 2025
170d37c
Update rollup config for preview mode
Arnesfield May 30, 2025
8d5cdce
Rename constants for types
Arnesfield May 30, 2025
d6169b6
Refactor plugin and rename some variables
Arnesfield May 30, 2025
be44310
Require node >=20.12.0
Arnesfield May 30, 2025
412b8df
Update dependencies
Arnesfield May 31, 2025
37fe64a
Add formatBytes spec
Arnesfield May 31, 2025
a756b7d
Remove deprecated RollupOutputSizeOptions interface
Arnesfield May 31, 2025
2c63aa8
Update OutputInfo.gzip doc
Arnesfield May 31, 2025
5ade650
Update package.json scripts
Arnesfield May 31, 2025
3121a8a
Add eslint-plugin-jsdoc dev dependency
Arnesfield May 31, 2025
21e5c36
Add jsdoc eslint plugin to eslint config
Arnesfield May 31, 2025
bb332a5
Fix eslint errors
Arnesfield May 31, 2025
d0e49b4
Ignore node_modules in mocha config
Arnesfield May 31, 2025
3dbb3d6
Update preview image
Arnesfield May 31, 2025
6eb1c0d
Update node version in workflow config
Arnesfield May 31, 2025
51ddbd2
2.0.0
Arnesfield May 31, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: ['>=20.12.0', 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
Expand Down
1 change: 1 addition & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
require: 'tsx',
spec: ['**/*.spec.ts'],
ignore: ['node_modules/**/*'],
watchFiles: ['src', 'test'],
watchIgnore: ['test/fixtures']
};
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[npm-img]: https://img.shields.io/npm/v/rollup-plugin-output-size.svg
[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/7cc3b49fc8496cc71db41a0f273871636520a611/preview.png

# rollup-plugin-output-size

[![npm][npm-img]][npm-url]
[![Node.js CI][ci-img]][ci-url]

[npm-img]: https://img.shields.io/npm/v/rollup-plugin-output-size.svg
[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/916870f919fea8c8c61dfaf10afb32f892583111/preview.png

A Rollup plugin that displays output bundle sizes.

> This project was inspired by [rollup-plugin-bundle-size](https://github.com/vimeo/rollup-plugin-bundle-size).
> This project was inspired by [rollup-plugin-bundle-size](https://www.npmjs.com/package/rollup-plugin-bundle-size).

![rollup-plugin-output-size example output][preview-img]

Expand Down Expand Up @@ -49,14 +49,14 @@ You can change and override the behavior of this plugin through its options. Not

### bytes

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

Displays the size in bytes for both the output info and [`summary`](#summary) output (e.g. `4,096 B` instead of `4.1 kB`).

### hide

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

Disables output types display.
Expand All @@ -65,13 +65,13 @@ Set to `true` to disable output for all output types, or set an array to specify

Output types are: `asset`, `chunk`, and `entry`.

> Note: Both `chunk` and `entry` output types are `OutputChunk`s but `entry` chunks have `isEntry` values of `true`.
Both `chunk` and `entry` output types are `OutputChunk`s but `entry` chunks have `isEntry` values of `true`.

This option does not affect [`summary`](#summary) output.
This option does not affect the [`summary`](#summary) output.

### gzip

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

Gets gzipped sizes of output.
Expand All @@ -80,17 +80,17 @@ Set to `false` to skip getting gzipped size, or set an array to only get gzipped

### silent

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

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

### summary

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

Displays summary output.
Displays the 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 Down
7 changes: 7 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import eslint from '@eslint/js';
// @ts-expect-error: package has no type declarations
import pluginChaiFriendly from 'eslint-plugin-chai-friendly';
import jsdoc from 'eslint-plugin-jsdoc';
import globals from 'globals';
import tseslint from 'typescript-eslint';

Expand Down Expand Up @@ -37,6 +38,7 @@ export default tseslint.config(
eqeqeq: ['warn', 'always', { null: 'ignore' }],
'no-constant-condition': 'warn',
'no-empty': 'warn',
'no-lonely-if': 'warn',
'no-throw-literal': 'warn',
'no-unused-expressions': 'off', // use typescript-eslint
'no-unused-private-class-members': 'warn',
Expand All @@ -50,6 +52,11 @@ export default tseslint.config(
semi: 'warn'
}
},
{
// for imported types used only in jsdoc comments
plugins: { jsdoc },
rules: { 'jsdoc/no-undefined-types': ['warn', { disableReporting: true }] }
},
{
// for tests only, override no-unused-expressions
files: ['**/*.spec.ts'],
Expand Down
Loading