-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement bundle with babel core-js@3 #1553
Conversation
- add @babel/runtime-corejs3 - add core-js
|
||
var returnHomeStyle = { padding: '0px', margin: '20px 0 20px 0' }; | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as-is
return <main>
....
</main>
to-be
return (
<main
...
</main>
)
} | ||
|
||
// get data | ||
getData = (url, page) => { | ||
getData = async (url, page) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add async await
@@ -88,6 +91,7 @@ | |||
"sinon": "^7.4.2", | |||
"style-loader": "^1.2.1", | |||
"webpack": "^4.43.0", | |||
"webpack-cli": "^3.3.11", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move package (dev)
"@babel/plugin-transform-async-to-generator": "^7.12.1", | ||
"@babel/plugin-transform-runtime": "^7.12.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
@@ -97,6 +101,7 @@ | |||
"react-dom": "^16.8.0" | |||
}, | |||
"dependencies": { | |||
"@babel/runtime-corejs3": "^7.12.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
@@ -2,12 +2,12 @@ const webpack = require('webpack'); | |||
|
|||
module.exports = { | |||
entry: { | |||
app: "./examples/Router/index.js" | |||
app: ['core-js/stable', 'regenerator-runtime/runtime', './examples/Router/index.js'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
insert entry
@@ -1,11 +1,18 @@ | |||
{ | |||
"parser": "babel-eslint", | |||
"settings": { | |||
"import/extensions": [".js"], | |||
"react": { | |||
"version": "latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add version
"@babel/plugin-transform-runtime", | ||
{ | ||
"corejs": 3, | ||
"regenerator": true | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set core-js
"browsers": [ | ||
"ie >= 11", | ||
"> 1%", | ||
"iOS >= 8", | ||
"Android >= 4" | ||
], | ||
"node": "6.10" | ||
}, | ||
"useBuiltIns": "usage", | ||
"debug": false, | ||
"modules": false, | ||
"corejs": { | ||
"version": 3, | ||
"proposals": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set core-js
I didn't get a chance to review this but hope to this coming week. Btw, did you see the email I sent you? |
This PR added the process of inserting core-js during build and transpiling.
I want to show it as CodeSansBox, but CodeSandBox is not support IE
So you have to check it locally.
I've tested it in Chrome and IE.
Solved to fix this #835
I think... It seems to be insufficient, but there is no problem with the build and transpiling.
thanks!
ref :