Skip to content

Instantly share code, notes, and snippets.

@amonks
Created October 7, 2016 18:37
Show Gist options
  • Save amonks/871edce356f97f06cc1351a69c8d3af1 to your computer and use it in GitHub Desktop.
Save amonks/871edce356f97f06cc1351a69c8d3af1 to your computer and use it in GitHub Desktop.

So you want to babel all of your javascript, but you don't want to think about gulp or webpack or crap like that. You want to use tools that come preinstalled on OSX.

Use this.

#! /usr/bin/env zsh
for OLD in src/**/*.js ; do
NEW=`echo "$OLD" | cut -b 5-`
mkdir -p `dirname $NEW`
echo "transpiling $OLD"
./node_modules/.bin/babel $OLD > $NEW
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment