From e8449513bbfdc2bacf8f758e7c79f246cb2fa93c Mon Sep 17 00:00:00 2001 From: Rory Abraham Date: Tue, 29 Dec 2020 17:38:36 -0800 Subject: [PATCH] Move metro config back to its own file and out of package.json --- metro.config.js | 29 +++++++++++++++++++++++++++++ package.json | 11 ----------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/metro.config.js b/metro.config.js index e69de29bb2d1..4674aa548d0d 100644 --- a/metro.config.js +++ b/metro.config.js @@ -0,0 +1,29 @@ +/** + * Metro configuration for React Native + * https://github.com/facebook/react-native + * + * @format + */ + +const {getDefaultConfig} = require('metro-config'); + +module.exports = (async () => { + const { + resolver: {assetExts}, + } = await getDefaultConfig(); + return { + resolver: { + assetExts: assetExts.filter(ext => ext !== 'svg'), + sourceExts: ['jsx', 'js', 'ts', 'tsx', 'json', 'svg'], + }, + transformer: { + getTransformOptions: async () => ({ + transform: { + experimentalImportSupport: false, + inlineRequires: false, + }, + }), + babelTransformerPath: require.resolve('react-native-svg-transformer'), + }, + }; +})(); diff --git a/package.json b/package.json index d40ae8931620..2dbb42221759 100644 --- a/package.json +++ b/package.json @@ -163,17 +163,6 @@ } } }, - "metro": { - "resolver": { - "sourceExts": [ - "jsx", - "js", - "ts", - "tsx", - "json" - ] - } - }, "prettier": { "bracketSpacing": false, "jsxBracketSameLine": true,