Skip to content

Commit f34b13d

Browse files
Remove unnecessary import/export lines from concatenated definition file (#53)
1 parent 8fa9d6a commit f34b13d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/bash
22
tsc --project tsconfig-build.json
33
ncc build ./build-tmp/index.js -o ./build
4-
cat ./build-tmp/codes.d.ts >> ./build-tmp/index.d.ts
5-
mv ./build-tmp/index.d.ts ./build
4+
cat ./build-tmp/index.d.ts >> ./build-tmp/codes.d.ts
5+
# Because we are concatting .d.ts files, we need to remove all imports of codes.ts from index.ts
6+
sed -i.old '/^import/d' ./build-tmp/codes.d.ts
7+
# as well as exports that already exist within codes.ts
8+
sed -i.old '/^export { StatusCodes, ReasonPhrases, }/d;' ./build-tmp/codes.d.ts
9+
mv ./build-tmp/codes.d.ts ./build/index.d.ts
610
rm -rf ./build-tmp

0 commit comments

Comments
 (0)