Skip to content

Commit

Permalink
(ops): explicit newline for package size
Browse files Browse the repository at this point in the history
  • Loading branch information
rt2zz committed Feb 3, 2018
1 parent 82a6349 commit a40e4a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions LIBSIZE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Redux Persist Size Estimate
The following is a history of size estimates in bytes. This is calculated as a rollup minified production build, excluding the size of redux which is an assumed peer dependency. YMMV.

v5.6.7: 4724 Bytes
v5.6.8: 4724 Bytes
**v5.6.7**: 4724 Bytes
**v5.6.8**: 4724 Bytes
5 changes: 3 additions & 2 deletions scripts/size-estimator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
const { execSync } = require('child_process')
const packageJson = require('../package.json')

let packageVersion = packageJson.version
// we estimate redux size based on the content length of the minified umd build hosted by unpkg. This script is brittle but works.
let reduxSize = execSync("curl -sIL https://unpkg.com/redux/dist/redux.min.js | grep -i Content-Length | tail -1 | awk '{print $2}'").toString()
// we need to substract redux size from our umd build to get an estimate of our first party code size
let persistSize = execSync("wc -c < dist/redux-persist.min.js") - reduxSize

let packageVersion = packageJson.version
console.log(`v${packageVersion}: ${persistSize} Bytes`)
// note: markdown formatted for conveinence when appending to LIBSIZE.md
console.log(`**v${packageVersion}**: ${persistSize} Bytes `)

0 comments on commit a40e4a5

Please sign in to comment.