Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed release version in built package #65

Merged
merged 1 commit into from
Aug 3, 2016

Conversation

nickstenning
Copy link
Contributor

Rather than relying on the release version being passed in as config, build the current release version (as read from package.json) into the bundle.

We use browserify-versionify for this, rather than simply requiring package.json, as our current build toolchain does not support any kind of tree-shaking, so require('package.json') would pull the whole of the package.json file into the bundle.

@nickstenning
Copy link
Contributor Author

Hmm. Looks like the npm-shrinkwrap.json is broken here -- I tried to select only those bits we need, but I might have missed some.

It also looks like maybe npm shrinkwrap --dev has been missed at least once.

Rather than relying on the release version being passed in as config,
build the current release version (as read from `package.json`) into the
bundle.

We use browserify-versionify for this, rather than simply requiring
`package.json`, as our current build toolchain does not support any kind
of tree-shaking, so `require('package.json')` would pull the whole of
the `package.json` file into the bundle.
@nickstenning nickstenning force-pushed the embed-package-version branch from f0206c6 to af954a8 Compare August 2, 2016 13:18
@nickstenning
Copy link
Contributor Author

Okay, that's fixed. Also a "get everything to some kind of stable state" PR now open at #66.

@robertknight
Copy link
Member

We use browserify-versionify for this, rather than simply requiring package.json, as our current
build toolchain does not support any kind of tree-shaking, so require('package.json') would pull
the whole of the package.json file into the bundle.

FWIW there is a Browserify transform for that: https://github.com/nolanlawson/package-json-versionify

@robertknight
Copy link
Member

LGTM

@robertknight robertknight merged commit a51e0f3 into master Aug 3, 2016
@robertknight robertknight deleted the embed-package-version branch August 3, 2016 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants