andywer / leakage

🐛 Memory leak testing for node.
1.58k stars 52 forks source link

Use package.json files array #2

Closed btmills closed 7 years ago

btmills commented 7 years ago

Thanks for building this! :tada: I've been putting off adding a memory leak test for one of my modules for a while, and this made it super easy.

This PR adds the package.json files array so that only required files are shipped as part of the module, which shrinks the bundle by 96%. Most of the reduction comes from not including docs/failing-test.png.

Before:

$ npm pack
leakage-0.1.0.tgz
$ wc -c < leakage-0.1.0.tgz
125500
$ tar -tf leakage-0.1.0.tgz
package/package.json
package/.npmignore
package/README.md
package/LICENSE
package/CHANGELOG.md
package/docs/failing-test.png
package/lib/heapDiffUtil.js
package/lib/index.js
package/lib/iteration.js
package/lib/leakErrorFactory.js
package/lib/saveHeapDiffs.js
package/test/sample.test.js
package/test/sampleLib.js

After:

$ npm pack
leakage.0.1.0.tgz
$ wc -c < leakage-0.1.0.tgz
4528
$ tar -tf leakage-0.1.0.tgz
package/package.json
package/README.md
package/LICENSE
package/CHANGELOG.md
package/lib/heapDiffUtil.js
package/lib/index.js
package/lib/iteration.js
package/lib/leakErrorFactory.js
package/lib/saveHeapDiffs.js
andywer commented 7 years ago

Thanks, @btmills! 👌

Fills my heart with joy to read that my lil' afternoon project actually helped you fixing a leak 🙂