mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
38 lines
759 B
JavaScript
38 lines
759 B
JavaScript
|
// @remove-on-eject-begin
|
||
|
/**
|
||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*/
|
||
|
// @remove-on-eject-end
|
||
|
'use strict';
|
||
|
|
||
|
const babelJest = require('babel-jest');
|
||
|
|
||
|
const hasJsxRuntime = (() => {
|
||
|
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
require.resolve('react/jsx-runtime');
|
||
|
return true;
|
||
|
} catch (e) {
|
||
|
return false;
|
||
|
}
|
||
|
})();
|
||
|
|
||
|
module.exports = babelJest.createTransformer({
|
||
|
presets: [
|
||
|
[
|
||
|
require.resolve('babel-preset-react-app'),
|
||
|
{
|
||
|
runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
||
|
},
|
||
|
],
|
||
|
],
|
||
|
babelrc: false,
|
||
|
configFile: false,
|
||
|
});
|