Skip to content

Commit 691fb63

Browse files
committed
metro config fix
1 parent 998504c commit 691fb63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

metro.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
const path = require('path');
22
const withStorybook = require('@storybook/react-native/metro/withStorybook');
3-
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;
4-
// eslint-disable-next-line import/no-unresolved
3+
54
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
65
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');
76

8-
const sourceExts = [...defaultSourceExts, 'mjs'];
7+
const defaultConfig = getDefaultConfig(__dirname);
8+
9+
const sourceExts = [...defaultConfig.resolver.sourceExts, 'mjs'];
910

1011
const config = {
1112
transformer: {

0 commit comments

Comments
 (0)