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
Eject .babelrc instead of separate configs#705
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "presets": ["react-app"] | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| // @remove-on-eject-begin | ||
| /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. An additional grant | ||
| * of patent rights can be found in the PATENTS file in the same directory. | ||
| */ | ||
| // @remove-on-eject-end | ||
| const babelDev = require('../babel.dev'); | ||
| const babelJest = require('babel-jest'); | ||
| module.exports = babelJest.createTransformer(babelDev); | ||
| module.exports = babelJest.createTransformer({ | ||
| presets: [require.resolve('babel-preset-react-app')] | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -12,7 +12,7 @@ | ||
| const pathExists = require('path-exists'); | ||
| const paths = require('../../config/paths'); | ||
| module.exports = (resolve, rootDir) => { | ||
| module.exports = (resolve, rootDir, isEjecting) => { | ||
| const setupFiles = [resolve('config/polyfills.js')]; | ||
| if (pathExists.sync(paths.testsSetup)) { | ||
| // Use this instead of `paths.testsSetup` to avoid putting | ||
| @@ -26,7 +26,6 @@ module.exports = (resolve, rootDir) => { | ||
| '^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'), | ||
| '^.+\\.css$': resolve('config/jest/CSSStub.js') | ||
| }, | ||
| scriptPreprocessor: resolve('config/jest/transform.js'), | ||
| setupFiles: setupFiles, | ||
| testPathIgnorePatterns: ['<rootDir>/(build|docs|node_modules)/'], | ||
| testEnvironment: 'node', | ||
| @@ -35,5 +34,10 @@ module.exports = (resolve, rootDir) => { | ||
| if (rootDir) { | ||
| config.rootDir = rootDir; | ||
| } | ||
| if (!isEjecting) { | ||
| // This is unnecessary after ejecting because Jest | ||
Contributor 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. oh! | ||
| // will just use .babelrc in the project folder. | ||
| config.scriptPreprocessor = resolve('config/jest/transform.js'); | ||
| } | ||
| return config; | ||
| }; | ||
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.