Skip to content

Commit

Permalink
Move metro config back to its own file and out of package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Dec 30, 2020
1 parent a824e70 commit e844951
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
29 changes: 29 additions & 0 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -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'),
},
};
})();
11 changes: 0 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,6 @@
}
}
},
"metro": {
"resolver": {
"sourceExts": [
"jsx",
"js",
"ts",
"tsx",
"json"
]
}
},
"prettier": {
"bracketSpacing": false,
"jsxBracketSameLine": true,
Expand Down

0 comments on commit e844951

Please sign in to comment.