Created
November 17, 2019 17:29
-
-
Save DragorWW/c54f5c78fd4c1f2f56ed88c1f73ef4b0 to your computer and use it in GitHub Desktop.
Get import statistics by webpack
This file contains 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
const fs = require('fs'); | |
// run `webpack --profile --json > compilation-stats.json` before this script | |
const stats = require('./compilation-stats'); | |
fs.writeFileSync( | |
'import-top.tsv', | |
stats.modules | |
.map(i => { | |
return { | |
name: i.name, | |
count: i.reasons.length, | |
}; | |
}) | |
.map(i => `${i.name}\t${i.count}`) | |
.join('\n') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment