-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #987 from UNICEFECAR/fixImportIssue-208952
Reverted the package and metro config file to address the SVG
- Loading branch information
Showing
4 changed files
with
170 additions
and
21,712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); | ||
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); | ||
|
||
const defaultConfig = getDefaultConfig(__dirname); | ||
const { assetExts, sourceExts } = defaultConfig.resolver; | ||
/** | ||
* Metro configuration | ||
* https://facebook.github.io/metro/docs/configuration | ||
* | ||
* @type {import('metro-config').MetroConfig} | ||
*/ | ||
|
||
const blacklist = require('metro-config/src/defaults/exclusionList'); | ||
const blacklist = require('metro-config/src/defaults/exclusionList') | ||
const config = { | ||
resetCache: true, | ||
transformer: { | ||
babelTransformerPath: require.resolve('react-native-svg-transformer/react-native'), | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
}, | ||
}), | ||
}, | ||
resolver: { | ||
resetCache: true, | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
}, | ||
}), | ||
}, | ||
resolver: { | ||
blacklistRE: blacklist([/xk\/.*/]), | ||
assetExts: assetExts.filter((ext) => ext !== 'svg'), | ||
sourceExts: [...sourceExts, 'svg'], | ||
}, | ||
}; | ||
|
||
module.exports = mergeConfig(getDefaultConfig(__dirname), config); | ||
} | ||
}; | ||
|
||
module.exports = mergeConfig(getDefaultConfig(__dirname), config); |
Oops, something went wrong.