-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor babel setup for core-js polyfl usage
- Loading branch information
1 parent
4c1b2fc
commit 1ca48e3
Showing
8 changed files
with
371 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
module.exports = { | ||
ignore: ['node_modules/**'], | ||
babelrcRoots: ['.', 'packages/*'], | ||
presets: [['@babel/preset-env'], ['@babel/preset-react']], | ||
babelrcRoots: ['packages/examples/**'], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
debug: false, | ||
targets: { | ||
browsers: ['last 2 versions', 'explorer >= 11'] | ||
} | ||
} | ||
], | ||
'@babel/preset-react' | ||
], | ||
plugins: [ | ||
['@babel/plugin-proposal-class-properties'], | ||
['@babel/plugin-proposal-object-rest-spread'], | ||
['@babel/plugin-proposal-export-default-from'] | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-transform-runtime' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"babel-preset-gatsby", | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"browsers": ["last 2 versions", "explorer >= 11"] | ||
}, | ||
"useBuiltIns": "usage", | ||
"corejs": 2 | ||
} | ||
] | ||
], | ||
"@babel/preset-react" | ||
], | ||
"plugins": ["emotion"] | ||
"ignore": [ | ||
".*node_modules/(?!rewrite-pattern|regexpu-core|buble|react-live).*" | ||
], | ||
"plugins": [ | ||
"emotion", | ||
"@babel/plugin-proposal-class-properties", | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"@babel/plugin-proposal-export-default-from", | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-transform-runtime" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ edge >= 14 | |
firefox >= 52 | ||
chrome >= 49 | ||
safari >= 10 | ||
node 8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
const production = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
useBuiltIns: 'usage', | ||
corejs: 2 | ||
} | ||
], | ||
'@babel/preset-react' | ||
], | ||
ignore: ['node_modules/**', '**/*.test.js'], | ||
plugins: [ | ||
'@babel/plugin-transform-react-constant-elements', | ||
'transform-dev-warning', | ||
[ | ||
'react-remove-properties', | ||
{ | ||
properties: ['data-dnb-test', 'data-dnb-test-wrapper'] | ||
} | ||
], | ||
[ | ||
'transform-react-remove-prop-types', | ||
{ | ||
mode: 'wrap' | ||
} | ||
], | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-transform-runtime' | ||
] | ||
} | ||
|
||
module.exports = { | ||
env: { | ||
test: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: '10.6' | ||
} | ||
} | ||
], | ||
'@babel/preset-react' | ||
], | ||
ignore: ['node_modules/**'], | ||
plugins: [ | ||
'transform-dynamic-import', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-class-properties' | ||
] | ||
}, | ||
development: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
browsers: 'last 1 versions' | ||
} | ||
} | ||
], | ||
'@babel/preset-react' | ||
], | ||
ignore: ['node_modules/**', '**/*.test.js'], | ||
plugins: [ | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-class-properties' | ||
] | ||
}, | ||
production, | ||
'production-umd': { | ||
...production, | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
useBuiltIns: 'usage', | ||
corejs: 2, | ||
modules: false | ||
} | ||
], | ||
'@babel/preset-react' | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.