Permalink
Browse files

Babel

  • Loading branch information...
cazala committed Aug 7, 2016
1 parent 5e95fdf commit faf27892fb149f66a9dedac8cb9f425ebd689e28
Showing with 30 additions and 1 deletion.
  1. +7 −0 .babelrc
  2. +9 −0 package.json
  3. +5 −1 src/index.js
  4. +9 −0 webpack.config.js
@@ -0,0 +1,7 @@
{
"presets": ["es2015", "react"],
"plugins": [
"transform-object-rest-spread",
"jsx-display-if"
]
}
@@ -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"
}
}
@@ -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 }
@@ -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.