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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: manage published files via files option #5659

Merged
merged 2 commits into from Apr 17, 2020
Merged

Conversation

jackfranklin
Copy link
Collaborator

@jackfranklin jackfranklin commented Apr 16, 2020

Fixes #5648 .

Before

PATH                                  SIZE     %   
pbcopy                                0 B      0%  
before.txt                            0 B      0%  
mocha-config/base.js                  41 B     0%  
mocha-config/browser-bundle-tests.js  101 B    0%  
mocha-config/doclint-tests.js         104 B    0%  
travis/chromium.sh                    139 B    0%  
mocha-config/puppeteer-unit-tests.js  207 B    0%  
lib/TaskQueue.js                      277 B    0%  
Errors.js                             660 B    0%  
DeviceDescriptors.js                  671 B    0%  
.npmignore                            677 B    0%  
lib/Errors.js                         893 B    0%  
lib/TimeoutSettings.js                1.52 kB  0%  
lib/api.js                            1.84 kB  0%  
lib/Dialog.js                         1.93 kB  0%  
lib/EmulationManager.js               1.96 kB  0%  
lib/WebSocketTransport.js             1.99 kB  0%  
index.js                              2.02 kB  0%  
lib/Tracing.js                        2.4 kB   0%  
lib/PipeTransport.js                  2.52 kB  0%  
lib/Multimap.js                       2.74 kB  0%  
lib/Events.js                         2.83 kB  0%  
package.json                          2.88 kB  0%  
lib/Worker.js                         3 kB     0%  
lib/Puppeteer.js                      4.06 kB  0%  
lib/Target.js                         5.26 kB  1%  
lib/LifecycleWatcher.js               6.61 kB  1%  
lib/Connection.js                     8 kB     1%  
install.js                            8.57 kB  1%  
lib/ExecutionContext.js               8.88 kB  1%  
lib/Input.js                          9.13 kB  1%  
lib/helper.js                         9.89 kB  1%  
CONTRIBUTING.md                       10.4 kB  1%  
lib/Coverage.js                       11 kB    1%  
LICENSE                               11.3 kB  1%  
lib/Browser.js                        12.4 kB  1%  
lib/Accessibility.js                  14.6 kB  2%  
lib/BrowserFetcher.js                 16.1 kB  2%  
lib/USKeyboardLayout.js               18.9 kB  2%  
lib/JSHandle.js                       19.6 kB  2%  
README.md                             21.6 kB  2%  
lib/DOMWorld.js                       22.4 kB  2%  
lib/FrameManager.js                   23.1 kB  2%  
lib/NetworkManager.js                 25.3 kB  3%  
lib/DeviceDescriptors.js              30.7 kB  3%  
lib/Launcher.js                       35.1 kB  4%  
lib/Page.js                           47 kB    5%  
lib/protocol.d.ts                     523 kB   56% 
                                                   
DIR                                   SIZE     %   
travis/                               139 B    0%  
mocha-config/                         453 B    0%  
lib/                                  875 kB   94% 
.                                     934 kB   100%

PKGFILES SUMMARY
Size on Disk with Dependencies  ~720 MB
Size with Dependencies          ~668 MB
Publishable Size                ~934 kB
Number of Directories           4      
Number of Files                 48     

After

PATH                       SIZE     %
lib/TaskQueue.js           277 B    0%
Errors.js                  660 B    0%
DeviceDescriptors.js       671 B    0%
lib/Errors.js              893 B    0%
lib/TimeoutSettings.js     1.52 kB  0%
lib/api.js                 1.84 kB  0%
lib/Dialog.js              1.93 kB  0%
lib/EmulationManager.js    1.96 kB  0%
lib/WebSocketTransport.js  1.99 kB  0%
index.js                   2.02 kB  0%
lib/Tracing.js             2.4 kB   0%
lib/PipeTransport.js       2.52 kB  0%
lib/Multimap.js            2.74 kB  0%
lib/Events.js              2.83 kB  0%
lib/externs.d.ts           2.88 kB  0%
package.json               2.98 kB  0%
lib/Worker.js              3 kB     0%
lib/Puppeteer.js           4.06 kB  0%
lib/Target.js              5.26 kB  1%
lib/LifecycleWatcher.js    6.61 kB  1%
lib/Connection.js          8 kB     1%
lib/ExecutionContext.js    8.88 kB  1%
lib/Input.js               9.13 kB  1%
lib/helper.js              9.89 kB  1%
lib/Coverage.js            11 kB    1%
LICENSE                    11.3 kB  1%
lib/Browser.js             12.4 kB  1%
lib/Accessibility.js       14.6 kB  2%
lib/BrowserFetcher.js      16.1 kB  2%
lib/USKeyboardLayout.js    18.9 kB  2%
lib/JSHandle.js            19.6 kB  2%
README.md                  21.6 kB  2%
lib/DOMWorld.js            22.4 kB  2%
lib/FrameManager.js        23.1 kB  3%
lib/NetworkManager.js      25.3 kB  3%
lib/DeviceDescriptors.js   30.7 kB  3%
lib/Launcher.js            35.1 kB  4%
lib/Page.js                47 kB    5%
lib/protocol.d.ts          523 kB   57%

DIR                        SIZE     %
lib/                       877 kB   96%
.                          917 kB   100%

PKGFILES SUMMARY
Size on Disk with Dependencies  ~720 MB
Size with Dependencies          ~668 MB
Publishable Size                ~917 kB
Number of Directories           2
Number of Files                 39

Rather than a denylist (`.npmignore`) we can instead use an allowlist
via the `files` option in `package.json`. This makes it much harder to
accidentally include files or folders in the build as you have to
explicitly list the files that will be included.

Fixes #5648.
after.txt Outdated Show resolved Hide resolved
Copy link
Member

@mathiasbynens mathiasbynens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with those two files removed

@mathiasbynens mathiasbynens changed the title chore: Manage published files via files option chore: manage published files via files option Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce the amount of published files
3 participants