From 4e4ea5a5b03735a0ce6964685add1e3fac53513e Mon Sep 17 00:00:00 2001 From: Samuel Reed Date: Fri, 18 Jun 2021 11:20:16 -0400 Subject: [PATCH] chore(build): minor tweaks & reduce package size --- .npmignore | 1 + examples/mk-examples.sh | 8 +++++--- package.json | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..d838da9 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +examples/ diff --git a/examples/mk-examples.sh b/examples/mk-examples.sh index ffb9c80..4a01d3b 100755 --- a/examples/mk-examples.sh +++ b/examples/mk-examples.sh @@ -1,7 +1,9 @@ #!/bin/bash -cp ../textFit.js . -cat textFit.js | \ +DIR="$(dirname "$0")" + +cp $DIR/../textFit.js $DIR +cat $DIR/textFit.js | \ sed 's/function processItem(/async function processItem(/' | \ sed 's/\/\/ await injection point/await new Promise((resolve) => setTimeout(resolve, 500));/' \ - > textFit.slow.js + > $DIR/textFit.slow.js diff --git a/package.json b/package.json index a2dc259..facbefc 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "uglifyjs textFit.js > textFit.min.js", + "build-example": "sh examples/mk-examples.sh", "prepublish": "npm run build" }, "repository": {