Skip to content

Commit

Permalink
Supporting ES6 syntax via babel
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabriskie committed Jun 17, 2015
1 parent 40e99e9 commit 14e720d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"homepage": "https://github.com/mzabriskie/rackt-cli",
"dependencies": {
"babel": "^5.5.8",
"babel-core": "^5.5.6",
"babel-loader": "^5.1.4",
"karma": "^0.12.36",
Expand All @@ -35,7 +36,7 @@
"minimist": "^1.1.1",
"mocha": "^2.2.5",
"react": "^0.13.3",
"rf-release": "^0.4.0",
"rf-release": "[email protected]:mzabriskie/rf-release.git",
"webpack": "^1.9.10",
"webpack-dev-server": "^1.9.0"
}
Expand Down
15 changes: 14 additions & 1 deletion tasks/build
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
#!/bin/bash -e

BUILD="$RACKT_PATH/node_modules/.bin/webpack --devtool source-map --config $RACKT_PATH/webpack.build.js"
babel=$RACKT_PATH/node_modules/.bin/babel
webpack=$RACKT_PATH/node_modules/.bin/webpack
BUILD="$webpack --devtool source-map --config $RACKT_PATH/webpack.build.js"

# Clean old build
rm -rf build/

# Transpile ES6
$babel -d build/lib ./lib

# Generate bundle
mkdir -p dist
eval $BUILD
eval "MINIFY=1 $BUILD"

# Copy package
cp README.md build/
node -p 'p=require("./package");p.main="lib/main.js";p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > build/package.json
2 changes: 1 addition & 1 deletion tasks/release
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ if [ "$1" == "--preview" ] || [ "$1" == "-P" ] || [ "$1" == "-p" ]; then
else
# Release to npm
$RACKT_PATH/tasks/build
$RACKT_PATH/node_modules/.bin/release
$RACKT_PATH/node_modules/.bin/release -f ./build
fi

0 comments on commit 14e720d

Please sign in to comment.