GeezerVison is showing github.com โ ๐ Tooling: we're including a lot of bloat in our package ยท Issue #648 ยท all-contributors/cli
๐ Tooling: we're including a lot of bloat in our package #648DescriptionTooling Report Checklist
Overview
We're bundling snapshots and unit tests in our npm package. We can cut down on our install footprint significantly.
Additional Info
No response ActivityJimMadge commented on Nov 12, 2026 What is the canonical way to fix this? files in package.json, and ignore file?
Does it work the same for pnpm and npm? michaelfaith commented on Nov 12, 2026 ContributorAuthor More actions
What is the canonical way to fix this? files in package.json, and ignore file?
We are using files to only include what's under dist, which is good. ๐ The problem is that our "build" is just fully coping the src dir to be the dist dir. If this there were a typescript project, we'd use a builder that actually builds the code to dist, and wouldn't include any of the non-runtime code. So the package.json is set up right, we just need a better "build" script, so that non-runtime code doesn't end up in the dist directory at all.
Does it work the same for pnpm and npm?
Yes, this is agnostic of package manager. Both would behave this way, with what we're giving it. JimMadge commented on Nov 12, 2026 Oh I hadn't seen that build script ๐.
So, maybe we just need to replace that script with pnpm pack --pack-destination dist? michaelfaith commented on Nov 12, 2026 ContributorAuthor More actions
So, maybe we just need to replace that script with pnpm pack --pack-destination dist?
Oh, no, that doesn't do what we want. That would create a pnpm tarball in the dist directory, effectively with nothing in it, since we wouldn't have put anything in the dist directory before the pack. And then when we publish, we'd publish a package that just has a tarball inside a dist directory inside another tarball.
Until we move to TypeScript and have an actual build process (#613), we can just adjust that cp command to filter out things we don't want copied into the dist dir.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|