-
Notifications
You must be signed in to change notification settings - Fork 19
/
metro.config.js
27 lines (23 loc) · 904 Bytes
/
metro.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const path = require('path');
const withStorybook = require('@storybook/react-native/metro/withStorybook');
const defaultConfig = getDefaultConfig(__dirname);
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const config = {};
const finalConfig = mergeConfig(defaultConfig, config);
/**
* @type {import('@storybook/react-native/metro/withStorybook').WithStorybookOptions}
*/
const storybookOptions = {
// set this to "enabled: true" to enable storybook config always
enabled: process.env.STORYBOOK_ENABLED === 'true',
configPath: path.resolve(__dirname, './.ondevice'),
// set this to true to remove storybook from the bundle when disabled
onDisabledRemoveStorybook: false,
};
module.exports = withStorybook(finalConfig, storybookOptions);