Skip to content

Conversation

@Salakar
Copy link
Member

@Salakar Salakar commented Feb 13, 2019

Summary:

This PR addresses the first issue described in this comment.

Example usage before CLI was moved:
See https://github.com/ueno-llc/react-native-starter/blob/master/metro.config.js

Example usage after move + this PR:

// metro.config.js
const { resolve } = require('path');
const { mergeConfig } = require('metro-config');
const { getDefaultConfig } = require('@react-native-community/cli/build/util/loadMetroConfig');

const root = __dirname;
const reactNativePath = resolve(root, './node_modules/react-native');

const config = {
  resolver: {
    sourceExts: ['js', 'json', 'ts', 'tsx', 'css', 'scss'],
  },
  transformer: {
    babelTransformerPath: require.resolve('./scripts/transformer.js'),
  },
};

module.exports = mergeConfig(getDefaultConfig({ root, reactNativePath }), config);

Test Plan:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants