diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-03-07 04:41:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-07 12:41:52 +0800 |
commit | 12babdfe20eae91de1b60a5a3cfb7db0a5a04cb0 (patch) | |
tree | c93691dc81bef781cdc80974e4353feb8123023b /test/release/rollup-es.sh | |
parent | 397e48b97e18cf947c9c9eec0f66589cb92689a3 (diff) | |
download | tracifyjs-12babdfe20eae91de1b60a5a3cfb7db0a5a04cb0.tar.gz tracifyjs-12babdfe20eae91de1b60a5a3cfb7db0a5a04cb0.zip |
build external projects for verification testing (#4741)
Diffstat (limited to 'test/release/rollup-es.sh')
-rwxr-xr-x | test/release/rollup-es.sh | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/test/release/rollup-es.sh b/test/release/rollup-es.sh new file mode 100755 index 00000000..f9443ff8 --- /dev/null +++ b/test/release/rollup-es.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +alias uglify-js=$PWD/bin/uglifyjs +UGLIFY_OPTIONS=$@ + +minify_in_situ() { + DIRS="$1" + echo '> uglify-js' $DIRS $UGLIFY_OPTIONS + for i in `find $DIRS -name '*.js'` + do + echo "$i" + uglify-js "$i" $UGLIFY_OPTIONS -o "$i" + done +} + +rm -rf tmp/rollup \ +&& git clone https://github.com/rollup/rollup.git tmp/rollup \ +&& cd tmp/rollup \ +&& rm -rf .git/hooks \ +&& git checkout 3d80c06f895eab41e648ee99786fa68c72458b80 \ +&& patch -l -p1 <<EOF +--- a/package.json ++++ b/package.json +@@ -23 +22,0 @@ +- "prepublishOnly": "npm run lint && npm run test:only && npm run test:leak", +--- a/rollup.config.js ++++ b/rollup.config.js +@@ -1,5 +1,4 @@ + import { readFileSync } from 'fs'; +-import buble from 'rollup-plugin-buble'; + import resolve from 'rollup-plugin-node-resolve'; + import commonjs from 'rollup-plugin-commonjs'; + import json from 'rollup-plugin-json'; +@@ -25,12 +24,6 @@ export default [ + input: 'src/node-entry.js', + plugins: [ + json(), +- buble({ +- include: ['src/**', 'node_modules/acorn/**'], +- target: { +- node: '4' +- } +- }), + resolve(), + commonjs() + ], +@@ -48,12 +41,6 @@ export default [ + input: 'src/browser-entry.js', + plugins: [ + json(), +- buble({ +- include: ['src/**', 'node_modules/acorn/**'], +- target: { +- node: '4' +- } +- }), + resolve(), + commonjs(), + { +@@ -80,7 +67,6 @@ export default [ + plugins: [ + string({ include: '**/*.md' }), + json(), +- buble({ target: { node: 4 } }), + commonjs({ + include: 'node_modules/**' + }), +--- a/test/mocha.opts ++++ b/test/mocha.opts +@@ -1,2 +1 @@ +---require buble/register + test/test.js +EOF +ERR=$?; if [ "$ERR" != "0" ]; then echo "Error: $ERR"; exit $ERR; fi +minify_in_situ "bin" \ +&& minify_in_situ "browser" \ +&& minify_in_situ "src" \ +&& rm -rf node_modules \ +&& npm ci \ +&& rm -rf dist \ +&& npm run build \ +&& minify_in_situ "dist" \ +&& node_modules/.bin/mocha |