Skip to content

Commit

Permalink
include babel (es6 to es5 generator)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chow Hui Ling committed Jan 2, 2016
1 parent 84c98ec commit d39849f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
"es2015",
"react"
],
"plugins": [
"syntax-class-properties",
"syntax-decorators",
"syntax-object-rest-spread",

"transform-class-properties",
"transform-decorators-legacy",
"transform-object-rest-spread"
]
}
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.3.26",
"babel-eslint": "^4.1.6",
"babel-loader": "^6.2.0",
"babel-plugin-syntax-class-properties": "^6.3.13",
"babel-plugin-syntax-decorators": "^6.3.13",
"babel-plugin-syntax-object-rest-spread": "^6.3.13",
"babel-plugin-transform-class-properties": "^6.3.13",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.3.13",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"css-loader": "^0.23.1",
"eslint": "^1.10.3",
"eslint-loader": "^1.1.1",
Expand Down
9 changes: 9 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ var merge = require('webpack-merge');
const common = {
//entry accepts a path or an object of entries.
entry: PATHS.app,
//resolve.extensions allow imports without an extension
resolve: {
extensions: ['', '.js', '.jsx']
},
output: {
path: PATHS.build,
filename: 'bundle.js'
Expand Down Expand Up @@ -45,6 +49,11 @@ const common = {
// Always set this or webpack will traverse all files in base directory.
// can use 'exclude' also.
include: PATHS.app
},
{
test: /\.jsx?$/,
loaders: ['babel'],
include: PATHS.app
}
]
}
Expand Down

0 comments on commit d39849f

Please sign in to comment.