add ESTree to build testing

This commit is contained in:
alexlamsl 2021-04-29 02:28:21 +08:00
parent c7cbd7a278
commit 5967c07c22
4 changed files with 33 additions and 13 deletions

View File

@ -12,6 +12,7 @@ jobs:
- '-mb braces'
- '--ie8 -c'
- '-mc'
- '-p acorn --toplevel -mco spidermonkey'
- '--toplevel -mc passes=3,pure_getters,unsafe'
script:
- acorn.sh

View File

@ -6,18 +6,22 @@ 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
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/rollup \

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 \

View File

@ -1,6 +1,6 @@
#!/bin/sh
alias uglify-js="node --max-old-space-size=4096 $PWD/bin/uglifyjs"
alias uglify-js="node --max-old-space-size=8192 $PWD/bin/uglifyjs"
UGLIFY_OPTIONS=$@
minify_in_situ() {
@ -23,6 +23,17 @@ rm -rf tmp/web-tooling-benchmark \
+++ b/package.json
@@ -12 +11,0 @@
- "postinstall": "npm run build:terser-bundled && npm run build:uglify-js-bundled && npm run build",
--- a/src/bootstrap.js
+++ b/src/bootstrap.js
@@ -6 +6 @@ const gmean = require("compute-gmean");
-const package = require("../package.json");
+const package_json = require("../package.json");
@@ -65 +65 @@ function initialize() {
- document.title = \`Web Tooling Benchmark v\${package.version}\`;
+ document.title = \`Web Tooling Benchmark v\${package_json.version}\`;
@@ -68 +68 @@ function initialize() {
- versionDiv.innerHTML = \`v\${package.version}\`;
+ versionDiv.innerHTML = \`v\${package_json.version}\`;
--- a/src/cli-flags-helper.js
+++ b/src/cli-flags-helper.js
@@ -7 +6,0 @@ const targetList = new Set([