-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export ESM module. Fix backwards compatability issue. (#57)
- Loading branch information
1 parent
bf0b42d
commit 492331d
Showing
3 changed files
with
66 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/bin/bash | ||
rm -rf ./build | ||
rm -rf ./build-tmp | ||
tsc --project tsconfig-build.json | ||
ncc build ./build-tmp/index.js -o ./build | ||
ncc build ./build-tmp/index.js -o ./build/cjs | ||
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 | ||
mv ./build-tmp/codes.d.ts ./build/cjs/index.d.ts | ||
rm -rf ./build-tmp | ||
tsc --project tsconfig-build.json | ||
mv ./build-tmp ./build/es/ |
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