diff --git a/metro.config.js b/metro.config.js index 783f349..0a01322 100644 --- a/metro.config.js +++ b/metro.config.js @@ -1,17 +1,20 @@ -/** - * Metro configuration for React Native - * https://github.com/facebook/react-native - * - * @format - */ +const { getDefaultConfig } = require('metro-config'); -module.exports = { - transformer: { - getTransformOptions: async () => ({ - transform: { - experimentalImportSupport: false, - inlineRequires: false, - }, - }), - }, -}; +module.exports = (async () => { + const { + resolver: { sourceExts }, + } = await getDefaultConfig(); + return { + resolver: { + sourceExts: [...sourceExts, 'cjs'], + }, + transformer: { + getTransformOptions: async () => ({ + transform: { + experimentalImportSupport: false, + inlineRequires: false, + }, + }), + }, + }; +})();