Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
set -e
TMP_DIR="/tmp/stimulus-polyfills"
OUT_FILE="$(pwd)/stimulus-polyfills.js"
mkdir -p "$TMP_DIR"
cd "$TMP_DIR"
echo "--- Installing dependencies"
npm install --save-dev rollup rollup-plugin-node-resolve rollup-plugin-commonjs @stimulus/polyfills 2>/dev/null
echo "--- Building"
cat << EOF > ./rollup.config.js
import resolve from "rollup-plugin-node-resolve"
import commonjs from "rollup-plugin-commonjs"
export default {
input: "node_modules/@stimulus/polyfills/index.js",
output: {
file: "$OUT_FILE",
format: "iife"
},
plugins: [
resolve(),
commonjs()
]
}
EOF
./node_modules/.bin/rollup -c rollup.config.js
rm -rf "$TMP_DIR"
echo
echo "Done!"
@javan

This comment has been minimized.

Copy link
Owner Author

commented Apr 30, 2019

$ curl -Ls https://git.io/fjZI5 | sh
--- Installing dependencies
+ rollup-plugin-commonjs@9.3.4
+ rollup-plugin-node-resolve@4.2.3
+ rollup@1.10.1
+ @stimulus/polyfills@1.1.1
added 129 packages from 145 contributors and audited 923 packages in 4.156s
found 0 vulnerabilities

--- Building

node_modules/@stimulus/polyfills/index.js → ../../../Users/javan/Desktop/stimulus-polyfills.js...
created ../../../Users/javan/Desktop/stimulus-polyfills.js in 580ms

Done!
$ ls -lh stimulus-polyfills.js 
-rw-r--r--  1 javan  staff    62K Apr 30 14:53 stimulus-polyfills.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.