|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
767 bytes
|
| Line | |
|---|
| 1 | // @remove-on-eject-begin
|
|---|
| 2 | /**
|
|---|
| 3 | * Copyright (c) 2014-present, Facebook, Inc.
|
|---|
| 4 | *
|
|---|
| 5 | * This source code is licensed under the MIT license found in the
|
|---|
| 6 | * LICENSE file in the root directory of this source tree.
|
|---|
| 7 | */
|
|---|
| 8 | // @remove-on-eject-end
|
|---|
| 9 | 'use strict';
|
|---|
| 10 |
|
|---|
| 11 | const babelJest = require('babel-jest').default;
|
|---|
| 12 |
|
|---|
| 13 | const hasJsxRuntime = (() => {
|
|---|
| 14 | if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
|---|
| 15 | return false;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | try {
|
|---|
| 19 | require.resolve('react/jsx-runtime');
|
|---|
| 20 | return true;
|
|---|
| 21 | } catch (e) {
|
|---|
| 22 | return false;
|
|---|
| 23 | }
|
|---|
| 24 | })();
|
|---|
| 25 |
|
|---|
| 26 | module.exports = babelJest.createTransformer({
|
|---|
| 27 | presets: [
|
|---|
| 28 | [
|
|---|
| 29 | require.resolve('babel-preset-react-app'),
|
|---|
| 30 | {
|
|---|
| 31 | runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
|---|
| 32 | },
|
|---|
| 33 | ],
|
|---|
| 34 | ],
|
|---|
| 35 | babelrc: false,
|
|---|
| 36 | configFile: false,
|
|---|
| 37 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.