-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: support declarationMap * chore: support declarationMap * chore: support declarationMap
- Loading branch information
1 parent
d608976
commit 772e597
Showing
4 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# NOTE: This library uses `pkgroll` to generate d.ts, but using `d.ts` created by tsc because `pkgroll` does not support `declarationMap`. | ||
|
||
# Terminate script on error | ||
set -e | ||
|
||
DIST_DIR="dist" | ||
TYPES_DIR="${DIST_DIR}/types" | ||
|
||
# build types | ||
npx tsc -p tsconfig.build.json || exit 1 | ||
|
||
# Delete unnecessary files (other than those related to index.d.ts) | ||
find ${DIST_DIR} -mindepth 1 ! -name 'index.d.ts' ! -name 'index.d.ts.map' -exec rm -rf {} + | ||
|
||
# move type definition files | ||
mkdir -p ${TYPES_DIR} | ||
mv ${DIST_DIR}/index.d.ts ${TYPES_DIR}/ | ||
mv ${DIST_DIR}/index.d.ts.map ${TYPES_DIR}/ | ||
|
||
# build | ||
pkgroll --tsconfig=tsconfig.build.json || exit 1 | ||
|
||
# restore type definition files | ||
mv ${TYPES_DIR}/index.d.ts ${DIST_DIR}/ | ||
mv ${TYPES_DIR}/index.d.ts.map ${DIST_DIR}/ | ||
|
||
# delete temporary directory | ||
rm -rf ${TYPES_DIR} | ||
|
||
echo "Build completed successfully!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters