Skip to content

Commit d6c5466

Browse files
committed
Don't build and test on npm install
Speed up travis builds, speed up local installs, unbreak 0.12 tests
1 parent bcb170c commit d6c5466

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"mocha": "src/**/__tests__/**/*.js"
2929
},
3030
"scripts": {
31-
"prepublish": "npm test && npm run build",
31+
"prepublish": "./resources/prepublish.sh",
3232
"test": "npm run lint && npm run check && npm run testonly",
3333
"testonly": "babel-node ./node_modules/.bin/_mocha $npm_package_options_mocha",
3434
"lint": "eslint src",

resources/prepublish.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Because of a long-running npm issue (https://github.com/npm/npm/issues/3059)
2+
# prepublish runs after `npm install` and `npm pack`.
3+
# In order to only run prepublish before `npm publish`, we have to check argv.
4+
if node -e "process.exit(($npm_config_argv).original[0].indexOf('pu') === 0)"; then
5+
exit 0;
6+
fi
7+
8+
npm test && npm run build

0 commit comments

Comments
 (0)