commit 90cf5f80eb2776c03331dae83d948c7e9dc9e115
parent 93cb46f88e025f197e29784990c04c5beb16b2a4
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 27 Feb 2017 22:09:21 +0300
[build] cleanup babel plugins and presets config
Diffstat:
4 files changed, 15 insertions(+), 39 deletions(-)
diff --git a/config/polyfills.js b/config/polyfills.js
@@ -1,14 +0,0 @@
-if (typeof Promise === 'undefined') {
- // Rejection tracking prevents a common issue where React gets into an
- // inconsistent state due to an error, but it gets swallowed by a Promise,
- // and the user has no idea what causes React's erratic future behavior.
- require('promise/lib/rejection-tracking').enable();
- window.Promise = require('promise/lib/es6-extensions.js');
-}
-
-// fetch() polyfill for making API calls.
-require('whatwg-fetch');
-
-// Object.assign() is commonly used with React.
-// It will use the native implementation if it's present and isn't buggy.
-Object.assign = require('object-assign');
diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js
@@ -46,7 +46,6 @@ module.exports = {
// require.resolve('webpack/hot/dev-server'),
require.resolve('react-dev-utils/webpackHotDevClient'),
// We ship a few polyfills by default:
- require.resolve('./polyfills'),
// Finally, this is your app's code:
paths.appIndexJs
// We include the app code last so that if there is a runtime error during
diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js
@@ -55,7 +55,6 @@ module.exports = {
// In production, we only want to load the polyfills and the app code.
entry: [
'babel-polyfill',
- require.resolve('./polyfills'),
paths.appIndexJs
],
output: {
diff --git a/package.json b/package.json
@@ -4,11 +4,14 @@
"private": true,
"devDependencies": {
"autoprefixer": "6.5.1",
- "babel-core": "6.17.0",
"babel-eslint": "7.0.0",
- "babel-jest": "16.0.0",
"babel-loader": "6.2.5",
- "babel-preset-react-app": "^1.0.0",
+ "babel-plugin-transform-async-generator-functions": "^6.22.0",
+ "babel-plugin-transform-class-properties": "^6.23.0",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
+ "babel-preset-es2015": "^6.22.0",
+ "babel-preset-es2016": "^6.22.0",
+ "babel-preset-es2017": "^6.22.0",
"case-sensitive-paths-webpack-plugin": "1.1.4",
"chalk": "1.1.3",
"connect-history-api-fallback": "1.3.0",
@@ -31,7 +34,6 @@
"gzip-size": "3.0.0",
"html-webpack-plugin": "2.24.0",
"http-proxy-middleware": "0.17.2",
- "jest": "16.0.2",
"json-loader": "0.5.4",
"legacy-loader": "0.0.2",
"object-assign": "4.1.0",
@@ -51,6 +53,7 @@
"whatwg-fetch": "1.0.0"
},
"dependencies": {
+ "babel-polyfill": "^6.23.0",
"browser-filesaver": "^1.1.1",
"escape-html": "^1.0.3",
"image-promise": "^4.0.1",
@@ -66,27 +69,16 @@
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
},
- "jest": {
- "moduleFileExtensions": [
- "jsx",
- "js",
- "json"
- ],
- "moduleNameMapper": {
- "^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/config/jest/FileStub.js",
- "^.+\\.css$": "<rootDir>/config/jest/CSSStub.js"
- },
- "setupFiles": [
- "<rootDir>/config/polyfills.js"
- ],
- "testPathIgnorePatterns": [
- "<rootDir>/(build|docs|node_modules)/"
- ],
- "testEnvironment": "node"
- },
"babel": {
"presets": [
- "react-app"
+ "es2015",
+ "es2016",
+ "es2017"
+ ],
+ "plugins": [
+ "transform-es2015-modules-commonjs",
+ "transform-async-generator-functions",
+ "transform-class-properties"
]
},
"eslintConfig": {