Skip to content

Commit 568b7f7

Browse files
committed
copy index.d.ts to published src directory
1 parent ce4bdec commit 568b7f7

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
@@ -23,7 +23,7 @@
2323
"test:watch": "BABEL_ENV=test jest --watch",
2424
"lint": "eslint ./src ./__tests__",
2525
"prettier": "prettier --config ./.prettierrc --write \"{src,stories,__tests__}/**/*.js\"",
26-
"prepublishOnly": "BABEL_ENV=production babel ./src --out-dir ./cjs",
26+
"prepublishOnly": "yarn test && ./publish.sh",
2727
"storybook": "start-storybook -p 3000",
2828
"storybook:build": "build-storybook",
2929
"storybook:export": "build-storybook -c .storybook -o build",

publish.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rm -rf ./cjs
2+
3+
# Process src JS with Babel
4+
BABEL_ENV=production babel ./src --out-dir ./cjs
5+
6+
# Copy typings
7+
cp ./src/index.d.ts ./cjs
8+
echo "Copied typings to /cjs"

0 commit comments

Comments
 (0)