Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

build(npm): whitelist production files #332

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

ghost
Copy link

@ghost ghost commented Aug 10, 2021

Description

This PR fixes #331 by whitelisting the production files and reducing the unpacked size from 5.3 MB to 708.5 kB (87% reduction).

You can run npm publish --dry-run to test it.
https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run

Note that you need to use npm v7.

Without whitelisting

npm notice package size:  1.5 MB                                  
npm notice unpacked size: 5.3 MB                                  
npm notice shasum:        8db0918e89b65e23aba81c3047f3b83a3b700556
npm notice integrity:     sha512-wbP+UrDG7zCXb[...]w98Xrt+sclRfw==
npm notice total files:   495  

With whitelisting

npm notice === Tarball Details ===                 
npm notice filename:      -.tgz                                   
npm notice package size:  144.9 kB                                
npm notice unpacked size: 708.5 kB                                
npm notice shasum:        4c0fc12a54d8b969d99fc07fde1ed6552de37257
npm notice integrity:     sha512-S2Lk86ZsWjl1P[...]EgpBW41bZU/mQ==
npm notice total files:   226     

Motivation and Context

How has this been tested?

You can run npm publish --dry-run to test it.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • Add tests to cover changes as needed.
  • Update documentation as needed.

@ghost ghost requested review from AmritKumar and bb111189 as code owners August 10, 2021 05:57
@ghost ghost requested review from renlulu and teye August 10, 2021 05:58
@ghost ghost closed this Aug 11, 2021
@ghost ghost reopened this Aug 11, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2021

Codecov Report

Merging #332 (482ebf9) into dev (6add1ea) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #332   +/-   ##
=======================================
  Coverage   79.19%   79.19%           
=======================================
  Files          45       45           
  Lines        1817     1817           
  Branches      304      304           
=======================================
  Hits         1439     1439           
  Misses        377      377           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6add1ea...482ebf9. Read the comment docs.

@ghost ghost force-pushed the build/whitelist-production-files branch from 4ced1c1 to 482ebf9 Compare August 11, 2021 05:47
@ghost ghost marked this pull request as draft August 11, 2021 10:35
@ghost ghost marked this pull request as ready for review August 11, 2021 10:46
@ghost
Copy link
Author

ghost commented Aug 11, 2021

@bb111189 bb111189 merged commit c054901 into dev Aug 12, 2021
@ghost ghost deleted the build/whitelist-production-files branch August 17, 2021 11:27
@ghost ghost mentioned this pull request Aug 25, 2021
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude non-production files in the published package
3 participants