Set --target when using tsc to remove comments

This commit is contained in:
Simon Warta
2020-08-13 10:47:50 +02:00
parent 8894f556a4
commit ab72909e60
4 changed files with 64 additions and 58 deletions
+4 -1
View File
@@ -9,6 +9,9 @@ OUTPUT_DIR="./src/generated/"
yarn pbts "$JS_SOURCE_FILE" -o "$DEFINITIONS_FILE"
yarn tsc --removeComments --outDir "$OUTPUT_DIR" --allowJs "$JS_SOURCE_FILE"
# Remove comments after using them for the .d.ts
# Note "When input files are specified on the command line, tsconfig.json files are ignored." (https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)
yarn tsc --removeComments --target es2017 --module commonjs --outDir "$OUTPUT_DIR" --allowJs "$JS_SOURCE_FILE"
cp "$DEFINITIONS_FILE" "$OUTPUT_DIR"
rm "$DEFINITIONS_FILE" "$JS_SOURCE_FILE"