support #__PURE__ in ESTree (#4879)

This commit is contained in:
Alex Lam S.L
2021-04-28 21:13:42 +01:00
committed by GitHub
parent a06e20304b
commit d576495e5a
7 changed files with 88 additions and 19 deletions

View File

@@ -6,6 +6,16 @@ UGLIFY_OPTIONS=$@
minify_in_situ() {
ARGS="$UGLIFY_OPTIONS --validate --in-situ"
DIRS="$1"
echo '> esbuild' $DIRS
for i in `find $DIRS -type f -name '*.ts' | grep -v '\.d\.ts'`
do
echo "$i"
CODE=`cat "$i"`
node_modules/.bin/esbuild --loader=ts --target=es2019 > "$i" <<EOF
$CODE
EOF
ARGS="$ARGS $i"
done
echo '> uglify-js' $DIRS $UGLIFY_OPTIONS
for i in `find $DIRS -type f -name '*.js'`
do
@@ -16,12 +26,6 @@ minify_in_situ() {
ARGS="$ARGS $i"
done
uglify-js $ARGS
for i in `find $DIRS -type f -name '*.ts' | grep -v '\.d\.ts'`
do
echo "$i"
node_modules/.bin/esbuild --loader=ts --target=es2019 < "$i" \
| uglify-js $UGLIFY_OPTIONS -o "$i"
done
}
rm -rf tmp/sucrase \