JSPM

package-json-versionify

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21533
  • Score
    100M100P100Q142071F
  • License Apache-2.0

Browserify transform to strip package.json of everything but the version

Package Exports

  • package-json-versionify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (package-json-versionify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

package-json-versionify

Browserify transform to strip everything from package.json except for the "version" field.

Installation

npm install --save package-json-versionify

Description

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.:

{"version":"1.0.0"}