Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit 1c5fed2

Browse files
DeekyJayconnor4312
authored andcommitted
fix(publish): Error if there are compilation errors, run tests before publishing
1 parent 966d4c2 commit 1c5fed2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bin/upload-to-azure.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const [major, minor] = version.split('.');
1313
const blobVersion = process.argv[2] || `v${major}.${minor}`;
1414

1515
console.log(` → Compiling library ${blobVersion}`);
16-
webpack(wpconfig, err => {
17-
if (err) {
18-
console.error(err);
16+
webpack(wpconfig, (err, stats) => {
17+
if (err || (stats.compilation.errors && stats.compilation.errors.length)) {
18+
console.error(err ? err : stats.compilation.errors);
1919
return process.exit(1);
2020
}
2121

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build:ts": "tsc",
1515
"build:bundle": "webpack",
1616
"build:doc": "rimraf dist && tsc -m es2015 -t es6 --moduleResolution node && esdoc -c esdoc.json",
17-
"publish:azure": "node bin/upload-to-azure.js",
17+
"publish:azure": "npm run test && node bin/upload-to-azure.js",
1818
"prepare": "npm run -s build"
1919
},
2020
"repository": {

0 commit comments

Comments
 (0)