react-app-rewired-preact
Version:
Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the react-scripts
18 lines (15 loc) • 523 B
JavaScript
// TODO: remove file in major release
const babelJest = require('babel-jest');
const customPlugins = [];
try {
const decoratorsPluginPath = require.resolve('babel-plugin-transform-decorators-legacy');
customPlugins.push(decoratorsPluginPath);
console.log('⚡ Rewired added babel-plugin-transform-decorators-legacy');
} catch (e) {
//do nothing plugin not found
}
module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')],
plugins: customPlugins,
babelrc: true
});