Skip to content

Commit

Permalink
Clean dist after build for npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Q committed Apr 19, 2019
1 parent 75c1889 commit ea2b07c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .npmignore
@@ -1,6 +1,3 @@
__fixtures__
__mocks__
__tests__

dist/__fixtures__/
dist/__tests__/
__tests__
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"prestart": "zero prestart",
"build": "zero build --ts && zero build --no-clean",
"postbuild": "sh ./scripts/postbuild.sh",
"lint": "zero lint",
"dev": "zero test",
"test": "zero test --coverage",
Expand All @@ -21,7 +22,6 @@
"files": [
"docs",
"dist",
"typings",
"README.md",
"LICENSE"
],
Expand Down
9 changes: 9 additions & 0 deletions scripts/postbuild.sh
@@ -0,0 +1,9 @@
#!/bin/bash
echo "Cleaning dist...";

find ./dist -type f -name "*.test.*" -delete;
find ./dist -name "__tests__" -type d -exec rm -rf {} +;
find ./dist -name "__fixtures__" -type d -exec rm -rf {} +;

echo "";
echo "Post build complete!";

0 comments on commit ea2b07c

Please sign in to comment.