From 9cd170b9311ed7d3abfd35ef0153355e1eeec3f2 Mon Sep 17 00:00:00 2001 From: "C. T. Lin" Date: Mon, 2 May 2016 22:30:26 +0800 Subject: [PATCH] Close #1687, Replace es3ify with Babel ES3 transforms (#1688) --- .babelrc | 4 +++- build/es3ify.js | 25 ------------------------- package.json | 5 +++-- 3 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 build/es3ify.js diff --git a/.babelrc b/.babelrc index 641cd833e8..36cd9e7911 100644 --- a/.babelrc +++ b/.babelrc @@ -17,7 +17,9 @@ "transform-es2015-parameters", ["transform-es2015-destructuring", { "loose": true }], "transform-es2015-block-scoping", - "transform-object-rest-spread" + "transform-object-rest-spread", + "transform-es3-member-expression-literals", + "transform-es3-property-literals" ], "env": { "commonjs": { diff --git a/build/es3ify.js b/build/es3ify.js deleted file mode 100644 index f4639cf400..0000000000 --- a/build/es3ify.js +++ /dev/null @@ -1,25 +0,0 @@ -var glob = require('glob') -var fs = require('fs') -var es3ify = require('es3ify') - -glob('./@(lib|dist|es)/**/*.js', function (err, files) { - if (err) { - throw err - } - - files.forEach(function (file) { - fs.readFile(file, 'utf8', function (err, data) { - if (err) { - throw err - } - - fs.writeFile(file, es3ify.transform(data), function (err) { - if (err) { - throw err - } - - console.log('es3ified ' + file) // eslint-disable-line no-console - }) - }) - }) -}) diff --git a/package.json b/package.json index a7d3efd04f..83742f8922 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "build:umd": "cross-env BABEL_ENV=commonjs NODE_ENV=development webpack src/index.js dist/redux.js", "build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack src/index.js dist/redux.min.js", "build:examples": "cross-env BABEL_ENV=commonjs babel-node examples/buildAll.js", - "build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min && node ./build/es3ify", + "build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min", "prepublish": "npm run clean && npm run check:src && npm run build", "docs:clean": "rimraf _book", "docs:prepare": "gitbook install", @@ -89,10 +89,11 @@ "babel-plugin-transform-es2015-sticky-regex": "^6.3.13", "babel-plugin-transform-es2015-template-literals": "^6.3.13", "babel-plugin-transform-es2015-unicode-regex": "^6.3.13", + "babel-plugin-transform-es3-member-expression-literals": "^6.5.0", + "babel-plugin-transform-es3-property-literals": "^6.5.0", "babel-plugin-transform-object-rest-spread": "^6.3.13", "babel-register": "^6.3.13", "cross-env": "^1.0.7", - "es3ify": "^0.2.0", "eslint": "^1.10.3", "eslint-config-rackt": "^1.1.1", "eslint-plugin-react": "^3.16.1",