Skip to content

Commit 5143dbe

Browse files
authored
chore: ensure dist files before publishing (#479)
* chore: ensure dist files before publishing * fix(ci): use prepublishOnly hook prepublish hook is unexpectedly triggerred when running `npm install`
1 parent f28ef5a commit 5143dbe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"build:weapp": "CLIENT_PLATFORM=Weapp webpack --config webpack/weapp.js",
1717
"uglify:browser": "cd dist; uglifyjs av.js -m -c -o av-min.js --in-source-map av.js.map --source-map av-min.js.map; cd ..;",
1818
"uglify:weapp": "cd dist; uglifyjs av-weapp.js -m -c -o av-weapp-min.js --in-source-map av-weapp.js.map --source-map av-weapp-min.js.map; cd ..;",
19-
"build": "gulp build"
19+
"build": "gulp build",
20+
"prepublishOnly": "./script/check-version.js"
2021
},
2122
"dependencies": {
2223
"debug": "^2.2.0",

script/check-version.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
const assert = require('assert');
3+
assert(require('../').version === require('../package.json').version);
4+
assert(require('../bower.json').version === require('../package.json').version);

0 commit comments

Comments
 (0)