Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 26.9k
Document configuration and build process#362
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,23 +8,34 @@ | ||
| */ | ||
| module.exports = { | ||
| // Don't try to find .babelrc because we want to force this configuration. | ||
| babelrc: false, | ||
| presets: [ | ||
| // let, const, destructuring, classes, modules | ||
| require.resolve('babel-preset-es2015'), | ||
| // exponentiation | ||
| require.resolve('babel-preset-es2016'), | ||
| // JSX, Flow | ||
| require.resolve('babel-preset-react') | ||
| ], | ||
| plugins: [ | ||
| // function x(a, b, c,) { } | ||
| require.resolve('babel-plugin-syntax-trailing-function-commas'), | ||
| // await fetch() | ||
| require.resolve('babel-plugin-syntax-async-functions'), | ||
| // class { handleClick = () => { } } | ||
| require.resolve('babel-plugin-transform-class-properties'), | ||
| // { ...todo, completed: true } | ||
| require.resolve('babel-plugin-transform-object-rest-spread'), | ||
| require.resolve('babel-plugin-transform-react-constant-elements'), | ||
| // function* () { yield 42; yield 43; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gaearon what is this for? (just curious 💭 ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nvm it's an example of regenerator | ||
| require.resolve('babel-plugin-transform-regenerator'), | ||
| // Polyfills the runtime needed for async/await and generators | ||
| [require.resolve('babel-plugin-transform-runtime'), { | ||
| helpers: false, | ||
| polyfill: false, | ||
| regenerator: true | ||
| }] | ||
| }], | ||
| // Optimization: hoist JSX that never changes out of render() | ||
| require.resolve('babel-plugin-transform-react-constant-elements') | ||
| ] | ||
| }; | ||
Uh oh!
There was an error while loading. Please reload this 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.
this was the only non-comment change in this PR, is it intentional?
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.
Yea, I just moved it a few lines down for consistency with dev config (order shouldn’t matter for this transform).
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.
ah i didn't see it, nevermind then 👍