Skip to content

Commit

Permalink
chore(@rn/metro-config, version): update metro config file and use sa…
Browse files Browse the repository at this point in the history
…me version as react-native
  • Loading branch information
Calinteodor committed Jan 18, 2024
1 parent deff729 commit bbd0719
Show file tree
Hide file tree
Showing 3 changed files with 945 additions and 28 deletions.
50 changes: 22 additions & 28 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
/* eslint-disable */
// Version-wise, react-native and @react-native/metro-config must be the same.

const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @format
* @type {import('metro-config').MetroConfig}
*/

const { getDefaultConfig } = require('metro-config');

module.exports = (async () => {
const {
resolver: {
sourceExts,
assetExts
}
} = await getDefaultConfig();
const {
resolver: {
sourceExts,
assetExts
}
} = getDefaultConfig();

return {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer'),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg']
}
const config = {
transformer: {
babelTransformerPath: require.resolve('react-native-svg-transformer')
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [ ...sourceExts, 'svg' ]
}
})();
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);

Check failure on line 29 in metro.config.js

View workflow job for this annotation

GitHub Actions / Lint

'__dirname' is not defined
Loading

0 comments on commit bbd0719

Please sign in to comment.