Skip to content
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

Eject .babelrc instead of separate configs #705

Merged
merged 1 commit into from
Sep 22, 2016
Merged

Eject .babelrc instead of separate configs #705

merged 1 commit into from
Sep 22, 2016

Conversation

gaearon
Copy link
Contributor

@gaearon gaearon commented Sep 22, 2016

Fixes #410, #674.
I’m going to bed now 😄 .
Haven’t actually tried it yet so if it doesn’t work, @fson feel free to polish & fix it.

@saintsjd
Copy link

saintsjd commented Sep 22, 2016

Could .babelrc live in the template/ folder instead? That way the user could edit it to add Relay support. This might help #662.

For example, if we created a babel-preset-react-relay-app, then the user could:

{
 "presets": ["react-relay-app", "react-app"]
 } 

@gaearon
Copy link
Contributor Author

gaearon commented Sep 22, 2016

After ejecting, it is moved to the root folder of your app.
For now, we don’t support customizing .babelrc before ejecting, although we may in the future.

const babelJest = require('babel-jest');

module.exports = babelJest.createTransformer(babelDev);
module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't really need this transformer any more. If you are creating a .babelrc, you can just use babel-jest directly by making it an explicit dependency and Jest will pick up the babelrc file.

@@ -35,5 +34,10 @@ module.exports = (resolve, rootDir) => {
if (rootDir) {
config.rootDir = rootDir;
}
if (!isEjecting) {
// This is unnecessary after ejecting because Jest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh!

@gaearon
Copy link
Contributor Author

gaearon commented Sep 22, 2016

Works locally, and e2e has a problem anyway: #707.
Merging.

@gaearon gaearon merged commit ba34b0b into master Sep 22, 2016
This was referenced Sep 22, 2016
feiqitian pushed a commit to feiqitian/create-react-app that referenced this pull request Oct 25, 2016
@gaearon gaearon deleted the babelrc branch March 6, 2017 02:40
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use standard .*rc files
3 participants