Browserify transform to strip everything from package.json
except for the "version"
field.
npm install --save package-json-versionify
Say you want to ship a library, and do something like:
MyLibrary.version = require('./package.json').version;
Unfortunately, if you do this, then your entire package.json
will be included in the output Browserify bundle, which will increase your bundle size. Bummer!
However, if you use this transform, then it will remove everything from package.json
except for the "version"
field. So when you require('./package.json')
, you get something much more compact, e.g.:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4