mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-08-16 02:44:58 +00:00
fix: example apps metro paths (#2511)
# Summary Fixes paths in Metro config
This commit is contained in:
@@ -6,14 +6,12 @@ const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
||||
*
|
||||
* @type {import('metro-config').MetroConfig}
|
||||
*/
|
||||
/* eslint-disable import/no-commonjs */
|
||||
|
||||
const path = require('path');
|
||||
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
||||
const escape = require('escape-string-regexp');
|
||||
const pack = require('../package.json');
|
||||
const pack = require('../../package.json');
|
||||
|
||||
const root = path.resolve(__dirname, '..');
|
||||
const root = path.resolve(__dirname, '../..');
|
||||
const projectNodeModules = path.join(__dirname, 'node_modules');
|
||||
|
||||
const modules = [...Object.keys(pack.peerDependencies)];
|
||||
@@ -32,19 +30,17 @@ const config = {
|
||||
)
|
||||
),
|
||||
nodeModulesPaths: [projectNodeModules, path.join(__dirname, '../../')],
|
||||
extraNodeModules: modules.reduce(
|
||||
(acc, name) => {
|
||||
acc[name] = path.join(__dirname, 'node_modules', name);
|
||||
return acc;
|
||||
},
|
||||
{ 'react-native-svg': `${__dirname}/../` }
|
||||
),
|
||||
extraNodeModules: modules.reduce((acc, name) => {
|
||||
acc[name] = path.join(__dirname, 'node_modules', name);
|
||||
return acc;
|
||||
}, {}),
|
||||
},
|
||||
|
||||
transformer: {
|
||||
getTransformOptions: async () => ({
|
||||
transform: {
|
||||
experimentalImportSupport: false,
|
||||
inlineRequires: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user