Permalink
Browse files

Add prepublishOnly script (#825)

* Add prepublishOnly script

* Use normal function instead of arrow
  • Loading branch information...
rubenmoya authored and developit committed Aug 24, 2017
1 parent 4ea1bc7 commit 56455738e5550d493cb9a32588ac724730dc3d55
Showing with 24 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +22 −0 config/prepublish.js
  3. +1 −0 package.json
@@ -4,6 +4,7 @@
/dist
/_dev
/coverage
/.package.json
# Additional bundles
/devtools.js
@@ -0,0 +1,22 @@
const path = require('path').join(__dirname, '..', 'package.json');
const pkg = require(path);
const UNNECESSARY_KEYS = [
'babel',
'greenkeeper',
'bundlesize',
'devDependencies',
'eslintConfig'
];
UNNECESSARY_KEYS.forEach(function (key) {
delete pkg[key];
});
pkg.scripts = {
donate: pkg.scripts.donate,
postinstall: pkg.scripts.postinstall,
postpublish: 'mv -f .package.json package.json'
};
require('fs').writeFileSync(path, JSON.stringify(pkg, null, 2));
@@ -32,6 +32,7 @@
"test:size": "bundlesize",
"lint": "eslint debug devtools src test",
"prepublish": "npm run build",
"prepublishOnly": "cp package.json .package.json; node config/prepublish.js",
"smart-release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
"release": "cross-env npm run smart-release",
"postinstall": "node ./config/donation-message.js"

0 comments on commit 5645573

Please sign in to comment.