Skip to content

chore: decrease package size #101

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

Merged
merged 1 commit into from
Feb 17, 2021
Merged

chore: decrease package size #101

merged 1 commit into from
Feb 17, 2021

Conversation

ehmicky
Copy link

@ehmicky ehmicky commented Feb 17, 2021

This decrease the npm package size, from 53KB to 6.7KB.

Before:

npm pack --dry
npm notice 
npm notice 📦  @netlify/[email protected]
npm notice === Tarball Contents === 
npm notice 2.0kB  CHANGELOG.md                                                               
npm notice 5.5kB  CODE_OF_CONDUCT.md                                                         
npm notice 1.1kB  LICENSE.md                                                                 
npm notice 6.6kB  README.md                                                                  
npm notice 606B   .github/ISSUE_TEMPLATE/bug_report.md                                       
npm notice 595B   .github/ISSUE_TEMPLATE/feature_request.md                                  
npm notice 822B   .github/workflows/fossa.yml                                                
npm notice 655B   .github/workflows/test.yml                                                 
npm notice 655B   .github/workflows/test.yml~                                                
npm notice 235B   .prettierignore                                                            
npm notice 47B    .prettierrc.json                                                           
npm notice 697B   helpers/doesNotNeedPlugin.js                                               
npm notice 888B   helpers/doesSiteUseNextOnNetlify.js                                        
npm notice 1.1kB  helpers/hasCorrectNextConfig.js                                            
npm notice 651B   helpers/isStaticExportProject.js                                           
npm notice 577B   helpers/isStaticExportProject.js~                                          
npm notice 1.4kB  helpers/validateNextUsage.js                                               
npm notice 1.4kB  helpers/validateNextUsage.js~                                              
npm notice 1.9kB  index.js                                                                   
npm notice 3.5kB  index.js~                                                                  
npm notice 28B    manifest.yml                                                               
npm notice 38.2kB next-on-netlify.png                                                        
npm notice 1.4kB  package.json                                                               
npm notice 1.5kB  package.json~                                                              
npm notice 0B     test/fixtures/deep_invalid_next_config/base/.gitkeep                       
npm notice 0B     test/fixtures/functions_copy_files/out_functions/next_random/next_random.js
npm notice 0B     test/fixtures/functions_copy_files/out_functions/next_random/nextJsPage.js 
npm notice 0B     test/fixtures/publish_copy_files/out_publish/subdir/dummy.txt              
npm notice 6.2kB  test/index.js                                                              
npm notice 5.4kB  test/index.js~                                                             
npm notice 100B   test/sample/netlify.toml                                                   
npm notice 98B    test/sample/netlify.toml~                                                  
npm notice 315B   test/sample/package.json~                                                  
npm notice 105B   test/sample/pages/_app.js                                                  
npm notice 140B   test/sample/pages/api/test.js                                              
npm notice 100B   test/sample/pages/index.js                                                 
npm notice 706B   test/sample/TESTING.md                                                     
npm notice === Tarball Details === 
npm notice name:          @netlify/plugin-nextjs                  
npm notice version:       2.0.0                                   
npm notice filename:      @netlify/plugin-nextjs-2.0.0.tgz        
npm notice package size:  53.0 kB                                 
npm notice unpacked size: 85.1 kB                                 
npm notice shasum:        0c71df74a7d42398f798a1fc3a0b0ee2120d7b4a
npm notice integrity:     sha512-eXnMM1CvBaQm4[...]7LXQBo59iXgGA==
npm notice total files:   37                                      
npm notice 
netlify-plugin-nextjs-2.0.0.tgz

After:

npm pack --dry
npm notice 
npm notice 📦  @netlify/[email protected]
npm notice === Tarball Contents === 
npm notice 2.0kB CHANGELOG.md                       
npm notice 1.1kB LICENSE.md                         
npm notice 6.6kB README.md                          
npm notice 697B  helpers/doesNotNeedPlugin.js       
npm notice 888B  helpers/doesSiteUseNextOnNetlify.js
npm notice 1.1kB helpers/hasCorrectNextConfig.js    
npm notice 651B  helpers/isStaticExportProject.js   
npm notice 1.4kB helpers/validateNextUsage.js       
npm notice 1.9kB index.js                           
npm notice 28B   manifest.yml                       
npm notice 1.5kB package.json                       
npm notice === Tarball Details === 
npm notice name:          @netlify/plugin-nextjs                  
npm notice version:       2.0.0                                   
npm notice filename:      @netlify/plugin-nextjs-2.0.0.tgz        
npm notice package size:  6.7 kB                                  
npm notice unpacked size: 17.8 kB                                 
npm notice shasum:        5cebfe2175d5120ab5ca4733ed522598819e6eb1
npm notice integrity:     sha512-YlgBzfwV8Vnd4[...]wnOOXa3y7URow==
npm notice total files:   11                                      
npm notice 
netlify-plugin-nextjs-2.0.0.tgz

@ehmicky ehmicky added the type: chore work needed to keep the product and development running smoothly label Feb 17, 2021
@ehmicky ehmicky self-assigned this Feb 17, 2021
Copy link

@lindsaylevine lindsaylevine left a comment

Choose a reason for hiding this comment

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

oh wow awesome 📝 thank you for this!!!!!

@ehmicky
Copy link
Author

ehmicky commented Feb 17, 2021

Note: we will need to remember to update the files property in package.json if we add any new files outside of helpers/**/*.js and index.js.

@ehmicky ehmicky merged commit 0e6d7d4 into main Feb 17, 2021
@ehmicky ehmicky deleted the chore/decrease-package-size branch February 17, 2021 21:06
lindsaylevine added a commit that referenced this pull request Feb 18, 2021
- fail build if plugin cant load next.config.js ([#99](#99))
- chore: decrease package size ([#101](#101))
- remove Next as a peer dependency ([#96](#96))
- update failure points in plugin to do nothing instead ([#94](#94))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants