Skip to content

Instantly share code, notes, and snippets.

@kenjij
Created November 17, 2016 18:53
Show Gist options
  • Select an option

  • Save kenjij/19a5287e82792100a1b7ca502ccd9fce to your computer and use it in GitHub Desktop.

Select an option

Save kenjij/19a5287e82792100a1b7ca502ccd9fce to your computer and use it in GitHub Desktop.
Compiling Reactjs/JSX using Babel
# Usage:
# - Install npm
# - Configure package.json
# - Place source code in "src/"
# - Outputs to "app.js"
npm run build
{
"name": "myapp",
"version": "0.0.0a",
"description": "A Reactjs app using JSX.",
"devDependencies": {
"babel-cli": "",
"babel-preset-es2015": "",
"babel-preset-react": ""
},
"scripts": {
"build": "babel src --out-file app.js --no-comments --minified"
},
"babel": {
"presets": ["react", "es2015"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment