unnecessary files are included in published package
I installed the latest release of pino and noticed that the published package includes several development-only files and directories, such as:
- `benchmarks/`
- `test/`
- `docs/`
- `tsconfig.json`
These files are not needed at runtime and significantly increase the installed package size
It would be great if these could be excluded from the published package, either by:
- adding a proper `.npmignore`, or
- using the `files` field in package.json as a whitelist
```
➜ pino tree -L 2
.
├── benchmarks
│ ├── basic.bench.js
│ ├── child.bench.js
│ ├── child-child.bench.js
│ ├── child-creation.bench.js
│ ├── deep-object.bench.js
│ ├── formatters.bench.js
│ ├── internal
│ ├── long-string.bench.js
│ ├── multi-arg.bench.js
│ ├── multistream.js
│ ├── object.bench.js
│ └── utils
├── bin.js
├── browser.js
├── build
│ └── sync-version.js
├── CNAME
├── CONTRIBUTING.md
├── docs
│ ├── api.md
│ ├── asynchronous.md
│ ├── benchmarks.md
│ ├── browser.md
│ ├── bundling.md
│ ├── child-loggers.md
│ ├── diagnostics.md
│ ├── ecosystem.md
│ ├── help.md
│ ├── lts.md
│ ├── pretty.md
│ ├── redaction.md
│ ├── transports.md
│ └── web.md
├── eslint.config.js
├── examples
│ ├── basic.js
│ └── transport.js
├── favicon.ico
├── file.js
├── inc-version.sh
├── index.html
├── lib
│ ├── caller.js
│ ├── constants.js
│ ├── deprecations.js
│ ├── levels.js
│ ├── meta.js
│ ├── multistream.js
│ ├── proto.js
│ ├── redaction.js
│ ├── symbols.js
│ ├── time.js
│ ├── tools.js
│ ├── transport.js
│ ├── transport-stream.js
│ └── worker.js
├── LICENSE
├── node_modules
├── package.json
├── pino.d.ts
├── pino.js
├── README.md
├── SECURITY.md
├── test
│ ├── basic.test.js
│ ├── broken-pipe.test.js
│ ├── browser-child.test.js
│ ├── browser-disabled.test.js
│ ├── browser-early-console-freeze.test.js
│ ├── browser-is-level-enabled.test.js
│ ├── browser-levels.test.js
│ ├── browser-serializers.test.js
│ ├── browser.test.js
│ ├── browser-timestamp.test.js
│ ├── browser-transmit.test.js
│ ├── complex-objects.test.js
│ ├── crlf.test.js
│ ├── custom-levels.test.js
│ ├── diagnostics.test.js
│ ├── error-key.test.js
│ ├── error.test.js
│ ├── escaping.test.js
│ ├── esm
│ ├── exit.test.js
│ ├── fixtures
│ ├── formatters.test.js
│ ├── helper.d.ts
│ ├── helper.js
│ ├── hooks.test.js
│ ├── http.test.js
│ ├── internals
│ ├── is-level-enabled.test.js
│ ├── jest
│ ├── levels.test.js
│ ├── metadata.test.js
│ ├── mixin-merge-strategy.test.js
│ ├── mixin.test.js
│ ├── multistream.test.js
│ ├── redact.test.js
│ ├── serializers.test.js
│ ├── stdout-protection.test.js
│ ├── syncfalse.test.js
│ ├── timestamp-nano.test.js
│ ├── timestamp.test.js
│ ├── transport
│ ├── transport-stream.test.js
│ └── types
└── tsconfig.json
16 directories, 94 files
➜ pino pwd
/home/yinsw/tsplayground/node_modules/pino
➜ pino du -h --max-depth 1
12K ./node_modules
708K ./test
12K ./examples
168K ./docs
92K ./lib
8.0K ./build
92K ./benchmarks
1.3M .
➜ pino
```
关闭于 2025-12-08 1 条评论