-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Conversation
Could .babelrc live in the For example, if we created a
|
After ejecting, it is moved to the root folder of your app. |
const babelJest = require('babel-jest'); | ||
|
||
module.exports = babelJest.createTransformer(babelDev); | ||
module.exports = babelJest.createTransformer({ | ||
presets: [require.resolve('babel-preset-react-app')] |
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.
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 |
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.
oh!
Works locally, and e2e has a problem anyway: #707. |
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.