Skip to content

Commit

Permalink
Remove unnecessary import/export lines from concatenated definition f…
Browse files Browse the repository at this point in the history
…ile (#53)
  • Loading branch information
prettymuchbryce committed Aug 23, 2020
1 parent 8fa9d6a commit f34b13d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/build.sh
@@ -1,6 +1,10 @@
#!/bin/bash
tsc --project tsconfig-build.json
ncc build ./build-tmp/index.js -o ./build
cat ./build-tmp/codes.d.ts >> ./build-tmp/index.d.ts
mv ./build-tmp/index.d.ts ./build
cat ./build-tmp/index.d.ts >> ./build-tmp/codes.d.ts
# Because we are concatting .d.ts files, we need to remove all imports of codes.ts from index.ts
sed -i.old '/^import/d' ./build-tmp/codes.d.ts
# as well as exports that already exist within codes.ts
sed -i.old '/^export { StatusCodes, ReasonPhrases, }/d;' ./build-tmp/codes.d.ts
mv ./build-tmp/codes.d.ts ./build/index.d.ts
rm -rf ./build-tmp

0 comments on commit f34b13d

Please sign in to comment.