Skip to content

Instantly share code, notes, and snippets.

@justinoboyle
Last active January 22, 2017 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinoboyle/c59e9521373cb74c3f7b8822a76e0d32 to your computer and use it in GitHub Desktop.
Save justinoboyle/c59e9521373cb74c3f7b8822a76e0d32 to your computer and use it in GitHub Desktop.
Simple Node + Babel Boilerplate
{
"presets": ["es2015", "stage-0"]
}

Clone this repository, delete .git, run npm install, and start writing your code in the src/ folder, where src/index.js is your entry file.

Run development environment

npm run dev

Package for production

npm run prestart

Run production

npm start

(Prestart is automatically run before start)

{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"clean": "rm -rf ./build && mkdir build",
"prestart": "npm run clean; babel -d ./build ./src -s",
"start": "ENV=production node build/index.js",
"dev": "ENV=dev babel-watch src/index.js"
},
"author": "author-name",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-0": "^6.22.0",
"babel-watch": "^2.0.5"
},
"dependencies": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment