Skip to content

Commit

Permalink
- Replace babel 6 dependencies with their babel 7 counterparts
Browse files Browse the repository at this point in the history
- Require babel 7 polyfill
- Adapt .babelrc file
  • Loading branch information
rouvenherzog committed Mar 7, 2019
1 parent 7d780a4 commit 251d2d2
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 14 deletions.
49 changes: 43 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
{
"presets": ["react", ["env", {
"targets": {
"browsers": ["safari >= 7", "ie 9"]
}
} ], "stage-0"]
}
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"safari >= 7",
"ie 9"
]
}
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
27 changes: 21 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,27 @@
"prop-types": "^15.6.0"
},
"devDependencies": {
"babel-core": "^6.13.2",
"babel-loader": "^6.2.4",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-0": "^6.5.0",
"babel-polyfill": "^6.26.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-bind": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.0",
"css-loader": "^0.26.1",
"file-loader": "^0.11.2",
"postcss-cli": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/require-babel-polyfill.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default (() => {
if((typeof window !== 'undefined' && !window._babelPolyfill) ||
(typeof global !== 'undefined' && !global._babelPolyfill)) {
require('babel-polyfill');
require("@babel/polyfill");
}
})()
})()

0 comments on commit 251d2d2

Please sign in to comment.