Created
August 21, 2017 17:11
-
-
Save developit/11bf91c3e4240ea3b615ac80684351d0 to your computer and use it in GitHub Desktop.
strip all non-essential fields from package.json prior to publishing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path').join(__dirname, '..', 'package.json'); | |
var pkg = require(path); | |
['babel', 'greenkeeper', 'bundlesize', 'devDependencies', 'eslintConfig'].forEach(function(key) { delete pkg[key] }); | |
pkg.scripts = { postinstall: pkg.scripts.postinstall, donate: pkg.scripts.donate }; | |
require('fs').writeFileSync(path, JSON.stringify(pkg, null, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment