-
-
Save Billy-/114b6d8e4d5662f7d3c8014586da155b to your computer and use it in GitHub Desktop.
Quickly identify files unused by webpack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------- # | |
webpack --display-modules | awk '{print $2}' | grep ^\.\/ > files-processed.txt; | |
cd src; # assumes all your files are here | |
find . -name *.js?(x) | grep -v eslint | grep -v __ > ../../files-all.txt; # excludes __tests__ and .eslintrc files | |
cd ..; | |
cat files-all.txt | xargs -I '{}' sh -c "grep -q '{}' files-processed.txt || echo '{}'"; | |
rm files-processed.txt files-all.txt; | |
# ----------------------------------- # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment