Skip to content

Commit

Permalink
fix: added storybook config in metro.config.js.ejs (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyd1997 authored Dec 6, 2023
1 parent 585f06c commit c9b2227
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generators/app/templates/metro.config.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const config = getDefaultConfig(__dirname, {
isCSSEnabled: true,
});

// https://github.com/dannyhw/expo-template-storybook/blob/24c892b62f953daeaf0ae6c52cb1331232d2c865/metro.config.js#L5-L7
config.resolver.resolverMainFields = ['sbmodern', ...config.resolver.resolverMainFields];

config.resolver.sourceExts = process.env.RN_SRC_EXT
? [...process.env.RN_SRC_EXT.split(',').concat(config.resolver.sourceExts), 'mjs']
: [...config.resolver.sourceExts, 'mjs'];
Expand Down

0 comments on commit c9b2227

Please sign in to comment.