Skip to content

Archives — 7-Zip without the junk ​

Everyday Send clients a zip, not node_modules.

Install 7-Zip CLI ​

  • Install 7-Zip
  • Ensure 7z is on PATH (often C:\Program Files\7-Zip\7z.exe)
powershell
7z --help

Zip a project excluding heavy folders ​

PowerShell (from parent of project):

powershell
$src = "D:\sites\client\awesome-theme"
$out = "D:\deliveries\awesome-theme-$(Get-Date -Format yyyyMMdd).zip"

# 7z exclude syntax: -xr!pattern (recursive)
& 7z a -tzip $out $src `
  -xr!node_modules `
  -xr!.git `
  -xr!vendor `
  -xr!dist `
  -xr!build `
  -xr!.next `
  -xr!coverage `
  -xr!.ddev\data `
  -xr!*.log

Common excludes ​

PatternWhy
node_modulesReinstall with npm/pnpm
.gitUnless they need full history
vendorPHP Composer — reinstall
dist / build / .nextRebuild
.ddev/data / DB dumpsHuge + often sensitive
.envNever ship secrets

Exclude env files explicitly ​

powershell
& 7z a -tzip $out $src -xr!node_modules -xr!.git -x!*.env -x!.env*

List / test archive ​

powershell
7z l $out
7z t $out

WSL / bash equivalent ​

bash
cd /mnt/d/sites/client
zip -r ~/deliveries/theme.zip awesome-theme \
  -x '*/node_modules/*' \
  -x '*/.git/*' \
  -x '*/vendor/*' \
  -x '*/.env'

Or with 7z inside WSL if installed.

tar.gz for Linux hosts ​

bash
tar --exclude=node_modules --exclude=.git -czf theme.tgz awesome-theme