Skip to content

Commit

Permalink
Babel
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Cazala committed Aug 7, 2016
1 parent 5e95fdf commit faf2789
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .babelrc
@@ -0,0 +1,7 @@
{
"presets": ["es2015", "react"],
"plugins": [
"transform-object-rest-spread",
"jsx-display-if"
]
}
9 changes: 9 additions & 0 deletions package.json
Expand Up @@ -16,6 +16,15 @@
"author": "Juan Cazala",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-plugin-jsx-display-if": "^3.0.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-react": "^6.11.1",
"babel-register": "^6.11.6",
"babel-runtime": "^6.11.6",
"webpack": "^1.13.1"
}
}
6 changes: 5 additions & 1 deletion src/index.js
@@ -1 +1,5 @@
console.log('hello world')
const obj = { a: 1, b:2, c:3 }
const { a, ...rest } = obj
const spread = { ...rest, d: 4 }
console.log(rest) // { b:2, c: 3}
console.log(spread) // { b:2, c: 3, d: 4 }
9 changes: 9 additions & 0 deletions webpack.config.js
Expand Up @@ -11,5 +11,14 @@ module.exports = {
resolve: {
extensions: ['', '.js', '.json'],
modulesDirectories: ['.', 'src', 'node_modules']
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/
}
]
}
}

0 comments on commit faf2789

Please sign in to comment.