Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add files to package.json #269

Merged
merged 2 commits into from Feb 13, 2019
Merged

add files to package.json #269

merged 2 commits into from Feb 13, 2019

Conversation

xavdid
Copy link
Contributor

@xavdid xavdid commented Feb 12, 2019

Right now, installing the package takes longer than average because all src files, tests, fixtures, etc are included. A consumer doesn't need any of that - they need the minimum it takes to run the code.

This PR uses the files property to be explicit about what should be included for distribution.

Before:

% npm pack --dry-run
npm notice
npm notice 馃摝  @postlight/mercury-parser@1.1.1
npm notice === Tarball Contents ===

           --- lots of files ---

npm notice === Bundled Dependencies ===
npm notice browser-request
npm notice jquery
npm notice moment-timezone
npm notice === Tarball Details ===
npm notice name:          @postlight/mercury-parser
npm notice version:       1.1.1
npm notice filename:      postlight-mercury-parser-1.1.1.tgz
npm notice package size:  5.3 MB
npm notice unpacked size: 21.6 MB
npm notice shasum:        e6473a868404a946b6ac9e6c817ecb841a263481
npm notice integrity:     sha512-Gi0kd3bKFdak3[...]Mu3Cjw+AyLmgw==
npm notice bundled deps:  3
npm notice bundled files: 526
npm notice own files:     562
npm notice total files:   1088
npm notice
postlight-mercury-parser-1.1.1.tgz

After:

% npm pack --dry-run
npm notice
npm notice 馃摝  @postlight/mercury-parser@1.1.1
npm notice === Tarball Contents ===
npm notice 5.2kB   package.json
npm notice 19.0kB  CHANGELOG.md
npm notice 1.4kB   cli.js
npm notice 4.0kB   README.md
npm notice 228.9kB dist/generate-custom-parser.js
npm notice 444.7kB dist/generate-custom-parser.js.map
npm notice 205.2kB dist/mercury.js
npm notice 351.5kB dist/mercury.js.map
npm notice 359.6kB dist/mercury.web.js
npm notice === Bundled Dependencies ===
npm notice browser-request
npm notice jquery
npm notice moment-timezone
npm notice === Tarball Details ===
npm notice name:          @postlight/mercury-parser
npm notice version:       1.1.1
npm notice filename:      postlight-mercury-parser-1.1.1.tgz
npm notice package size:  1.5 MB
npm notice unpacked size: 8.7 MB
npm notice shasum:        bb7febb27929786c95dc09dbe6ca2c56e34a1086
npm notice integrity:     sha512-trD3Q7jezH4dq[...]Ew3KeFv9gUvHA==
npm notice bundled deps:  3
npm notice bundled files: 526
npm notice own files:     9
npm notice total files:   535
npm notice
postlight-mercury-parser-1.1.1.tgz

Copy link
Contributor

@adampash adampash left a comment

This is great, thanks @xavdid!

@adampash adampash merged commit 867623a into postlight:master Feb 13, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants