Skip to content

Commit

Permalink
Update Babel to v7.0.0-beta.32 (kriasoft#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzzy authored Nov 14, 2017
1 parent 2322a99 commit 8bf7e66
Show file tree
Hide file tree
Showing 4 changed files with 642 additions and 737 deletions.
8 changes: 4 additions & 4 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
module.exports = {
presets: [
[
'env',
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'stage-2',
'flow',
'react',
'@babel/preset-stage-2',
'@babel/preset-flow',
'@babel/preset-react',
],
ignore: ['node_modules', 'build'],
};
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"browserslist": [">1%", "last 4 versions", "Firefox ESR", "not ie < 9"],
"dependencies": {
"babel-polyfill": "7.0.0-beta.3",
"@babel/polyfill": "7.0.0-beta.32",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"classnames": "^2.2.5",
Expand Down Expand Up @@ -38,20 +38,21 @@
"whatwg-fetch": "^2.0.3"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.32",
"@babel/node": "7.0.0-beta.32",
"@babel/plugin-transform-react-constant-elements": "7.0.0-beta.32",
"@babel/plugin-transform-react-inline-elements": "7.0.0-beta.32",
"@babel/preset-env": "7.0.0-beta.32",
"@babel/preset-flow": "7.0.0-beta.32",
"@babel/preset-react": "7.0.0-beta.32",
"@babel/preset-stage-2": "7.0.0-beta.32",
"assets-webpack-plugin": "^3.5.1",
"autoprefixer": "^7.1.6",
"babel-core": "7.0.0-beta.3",
"babel-eslint": "^8.0.1",
"babel-core": "^7.0.0-0",
"babel-eslint": "^8.0.2",
"babel-jest": "^21.2.0",
"babel-loader": "^7.1.2",
"babel-node": "7.0.0-beta.3",
"babel-plugin-transform-react-constant-elements": "7.0.0-beta.3",
"babel-plugin-transform-react-inline-elements": "7.0.0-beta.3",
"babel-loader": "8.0.0-beta.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.10",
"babel-preset-env": "7.0.0-beta.3",
"babel-preset-flow": "7.0.0-beta.3",
"babel-preset-react": "7.0.0-beta.3",
"babel-preset-stage-2": "7.0.0-beta.3",
"browser-sync": "^2.18.13",
"chokidar": "^1.7.0",
"css-loader": "^0.28.7",
Expand Down
20 changes: 10 additions & 10 deletions tools/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const config = {
// A Babel preset that can automatically determine the Babel plugins and polyfills
// https://github.com/babel/babel-preset-env
[
'env',
'@babel/preset-env',
{
targets: {
browsers: pkg.browserslist,
Expand All @@ -95,21 +95,21 @@ const config = {
],
// Experimental ECMAScript proposals
// https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-
'stage-2',
'@babel/preset-stage-2',
// Flow
// https://github.com/babel/babel/tree/master/packages/babel-preset-flow
'flow',
'@babel/preset-flow',
// JSX
// https://github.com/babel/babel/tree/master/packages/babel-preset-react
['react', { development: isDebug }],
['@babel/preset-react', { development: isDebug }],
],
plugins: [
// Treat React JSX elements as value types and hoist them to the highest scope
// https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements
...(isDebug ? [] : ['transform-react-constant-elements']),
...(isDebug ? [] : ['@babel/transform-react-constant-elements']),
// Replaces the React.createElement function with one that is more optimized for production
// https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements
...(isDebug ? [] : ['transform-react-inline-elements']),
...(isDebug ? [] : ['@babel/transform-react-inline-elements']),
// Remove unnecessary React propTypes from the production build
// https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types
...(isDebug ? [] : ['transform-react-remove-prop-types']),
Expand Down Expand Up @@ -295,7 +295,7 @@ const clientConfig = {
target: 'web',

entry: {
client: ['babel-polyfill', './src/client.js'],
client: ['@babel/polyfill', './src/client.js'],
},

plugins: [
Expand Down Expand Up @@ -376,7 +376,7 @@ const serverConfig = {
target: 'node',

entry: {
server: ['babel-polyfill', './src/server.js'],
server: ['@babel/polyfill', './src/server.js'],
},

output: {
Expand Down Expand Up @@ -405,10 +405,10 @@ const serverConfig = {
...rule.options,
presets: rule.options.presets.map(
preset =>
preset[0] !== 'env'
preset[0] !== '@babel/preset-env'
? preset
: [
'env',
'@babel/preset-env',
{
targets: {
node: pkg.engines.node.match(/(\d+\.?)+/)[0],
Expand Down
Loading

0 comments on commit 8bf7e66

Please sign in to comment.