Files
Jakub Grzywacz 1256d561df fix: react-native-macos@0.76+ (#2531)
# Summary

On `react-native-macos` 0.76, `UIGraphicsBeginImageContextWithOptions`
and some other UIGraphics directives were removed so the temporary
solution is to copy the removed functions here.

More details
here https://github.com/software-mansion/react-native-svg/issues/2528
and here https://github.com/microsoft/react-native-macos/pull/2209

Closes #2528

## Test Plan

Built the `fabric-macos-example` for with `react-native-macos@0.76.0`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| MacOS   |          |

## Checklist

- [x] I have tested this on a device and a simulator
2024-11-13 12:30:05 +01:00

46 lines
1.2 KiB
JavaScript

/**
* Metro configuration for React Native
* https://reactnative.dev/docs/metro
*
* @format
*/
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const pack = require('../../package.json');
const root = path.resolve(__dirname, '../..');
const projectNodeModules = path.join(__dirname, 'node_modules');
const modules = [...Object.keys(pack.peerDependencies), 'react-native-macos'];
const config = {
projectRoot: __dirname,
watchFolders: [root],
resolver: {
blockList: exclusionList(
modules.map(
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
),
),
nodeModulesPaths: [projectNodeModules, path.join(__dirname, '../../')],
extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
},
}),
assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);