Skip to content

Instantly share code, notes, and snippets.

@varl
Created May 31, 2018 14:20
Show Gist options
  • Save varl/00227ad3c1635049e62118a0cc1bd2c8 to your computer and use it in GitHub Desktop.
Save varl/00227ad3c1635049e62118a0cc1bd2c8 to your computer and use it in GitHub Desktop.
webpack bundle analyser monorepo
#!/usr/bin/env bash
WBA=./node_modules/.bin/webpack-bundle-analyzer
STATS_FILE=stats.json
for pkg in ./packages/*; do
file="${pkg}/${STATS_FILE}"
name="$(basename $pkg)"
$WBA "$file" "${pkg}/build" --mode static --report "reports/${name}.html" --no-open
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment