From 181bbdfe49cd284fc4c49a13448a184455225a21 Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Sat, 20 Aug 2016 16:32:59 -0400 Subject: [PATCH] Upgrade Babel --- .babelrc | 6 +++++- docs/src/ReactPlayground.js | 1 + package.json | 15 +++++++-------- tools/es/build.js | 6 +++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.babelrc b/.babelrc index 1608af173b..10ce061d77 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,9 @@ { - "presets": ["es2015-loose", "stage-1", "react"], + "presets": [ + ["es2015", { "loose": true }], + "stage-1", + "react" + ], "plugins": [ "dev-expression", "transform-runtime", diff --git a/docs/src/ReactPlayground.js b/docs/src/ReactPlayground.js index 8c4edd0477..4fc7f35a4b 100644 --- a/docs/src/ReactPlayground.js +++ b/docs/src/ReactPlayground.js @@ -167,6 +167,7 @@ const ReactPlayground = React.createClass({ return { transformer(code) { return transform(code, { + // TODO: Use preset options once babel-standalone v6.13 is released. presets: ['es2015-loose', 'react', 'stage-1'] }).code; } diff --git a/package.json b/package.json index 61d96d2b8b..8367f67525 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "tdd": "karma start", "test": "npm run lint && npm run test-browser && npm run test-node", "test-browser": "cross-env NODE_ENV=test karma start --single-run", - "test-node": "mocha --compilers js:babel-core/register test/server/*Spec.js" + "test-node": "mocha --compilers js:babel-register test/server/*Spec.js" }, "main": "lib/index.js", "jsnext:main": "es/index.js", @@ -43,20 +43,19 @@ }, "devDependencies": { "babel-cli": "^6.11.4", - "babel-eslint": "^6.1.0", - "babel-loader": "^6.2.4", + "babel-core": "^6.13.2", + "babel-eslint": "^6.1.2", + "babel-loader": "^6.2.5", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-dev-expression": "^0.2.1", "babel-plugin-istanbul": "^1.0.3", "babel-plugin-transform-es3-member-expression-literals": "^6.8.0", "babel-plugin-transform-es3-property-literals": "^6.8.0", "babel-plugin-transform-runtime": "^6.12.0", - "babel-preset-es2015": "^6.9.0", - "babel-preset-es2015-loose": "^7.0.0", - "babel-preset-es2015-webpack": "^6.4.2", - "babel-preset-es2015-webpack-loose": "^6.3.14", + "babel-preset-es2015": "^6.13.2", "babel-preset-react": "^6.11.1", - "babel-preset-stage-1": "^6.5.0", + "babel-preset-stage-1": "^6.13.0", + "babel-register": "^6.11.6", "babel-standalone": "^6.12.0", "bootstrap": "^3.3.6", "brfs": "^1.4.3", diff --git a/tools/es/build.js b/tools/es/build.js index 08f137eccf..0f8c18d5ac 100644 --- a/tools/es/build.js +++ b/tools/es/build.js @@ -11,7 +11,11 @@ export default function BuildES() { .then(() => fsp.mkdirs(esRoot)) .then(() => buildBabel(srcRoot, esRoot, { babelrc: false, - presets: ['es2015-webpack-loose', 'react', 'stage-1'], + presets: [ + ['es2015', { loose: true, modules: false }], + 'stage-1', + 'react' + ], plugins: [ 'dev-expression', 'transform-runtime',