123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
-
- const fs = require('fs');
- const path = require('path');
- const blacklist = require('metro-config/src/defaults/blacklist');
-
- const rnPath = fs.realpathSync(
- path.resolve(require.resolve('react-native/package.json'), '..'),
- );
- const rnwPath = fs.realpathSync(
- path.resolve(require.resolve('react-native-windows/package.json'), '..'),
- );
-
- module.exports = {
- resolver: {
- extraNodeModules: {
-
- 'react-native': rnwPath,
- 'react-native-windows': rnwPath,
- },
-
- platforms: ['ios', 'android', 'windesktop', 'windows', 'web', 'macos'],
-
-
- blacklistRE: blacklist([
- new RegExp(
- `${(path.resolve(rnPath) + path.sep).replace(/[/\\]/g, '/')}.*`,
- ),
-
-
- new RegExp(
- `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
- ),
-
- /.*\.ProjectImports\.zip/,
- ]),
- },
- transformer: {
- getTransformOptions: async () => ({
- transform: {
- experimentalImportSupport: false,
- inlineRequires: false,
- },
- }),
- },
- };
|