Upgrade to Babel 6.x
This commit is contained in:
parent
86f23ed1a4
commit
1dbc088d17
13
.babelrc
13
.babelrc
|
@ -1,3 +1,14 @@
|
||||||
{
|
{
|
||||||
"stage": 0
|
"presets": [
|
||||||
|
"es2015",
|
||||||
|
"react"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"production": {
|
||||||
|
"plugins": [
|
||||||
|
"transform-react-constant-elements",
|
||||||
|
"transform-react-inline-elements"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
11
package.json
11
package.json
|
@ -15,9 +15,16 @@
|
||||||
"author": "Tanner Collin (http://github.com/tannercollin)",
|
"author": "Tanner Collin (http://github.com/tannercollin)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^5.4.7",
|
"babel-core": "^6.21.0",
|
||||||
"babel-eslint": "^3.1.9",
|
"babel-eslint": "^3.1.9",
|
||||||
"babel-loader": "^5.1.2",
|
"babel-loader": "^6.2.10",
|
||||||
|
"babel-plugin-transform-react-constant-elements": "^6.9.1",
|
||||||
|
"babel-plugin-transform-react-inline-elements": "^6.8.0",
|
||||||
|
"babel-preset-es2015": "^6.18.0",
|
||||||
|
"babel-preset-es2016": "^6.16.0",
|
||||||
|
"babel-preset-es2017": "^6.16.0",
|
||||||
|
"babel-preset-latest": "^6.16.0",
|
||||||
|
"babel-preset-react": "^6.16.0",
|
||||||
"eslint-plugin-react": "^2.3.0",
|
"eslint-plugin-react": "^2.3.0",
|
||||||
"react-hot-loader": "^1.2.7",
|
"react-hot-loader": "^1.2.7",
|
||||||
"webpack": "^1.9.6",
|
"webpack": "^1.9.6",
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react'
|
import React from 'react';
|
||||||
import { Router, Route, browserHistory } from 'react-router'
|
import { Router, Route, browserHistory } from 'react-router';
|
||||||
import Site from './ui/Site';
|
import Site from './ui/Site';
|
||||||
|
|
||||||
React.render((
|
React.render((
|
||||||
<Router history={browserHistory}>
|
<Router history={browserHistory}>
|
||||||
<Route path="/*" component={Site} />
|
<Route path="/*" component={Site} />
|
||||||
</Router>
|
</Router>
|
||||||
), document.getElementById('root'))
|
), document.getElementById('root'));
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default class Home extends React.Component {
|
||||||
} catch (e) { // If we are on a browser without serviceWorker
|
} catch (e) { // If we are on a browser without serviceWorker
|
||||||
this.setState({registration: false});
|
this.setState({registration: false});
|
||||||
}
|
}
|
||||||
}.bind(this));
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ module.exports = {
|
||||||
module: {
|
module: {
|
||||||
loaders: [{
|
loaders: [{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loaders: ['react-hot', 'babel'],
|
loaders: ['react-hot', 'babel-loader'],
|
||||||
include: path.join(__dirname, 'src')
|
include: path.join(__dirname, 'src')
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,22 +13,22 @@ module.exports = {
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
|
||||||
compress: {
|
|
||||||
warnings: false
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
'NODE_ENV': JSON.stringify('production')
|
'NODE_ENV': JSON.stringify('production')
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
new webpack.optimize.UglifyJsPlugin({
|
||||||
|
compress: {
|
||||||
|
warnings: false
|
||||||
|
}
|
||||||
|
}),
|
||||||
new webpack.NoErrorsPlugin()
|
new webpack.NoErrorsPlugin()
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
loaders: [{
|
loaders: [{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
loaders: ['babel'],
|
loaders: ['babel-loader'],
|
||||||
include: path.join(__dirname, 'src')
|
include: path.join(__dirname, 'src')
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user