Skip to content

Commit

Permalink
removed unnecessary patch for rn-svg, added compact flag to babel, ad…
Browse files Browse the repository at this point in the history
…d comments and blockList to metro config
  • Loading branch information
bohdanprog committed May 6, 2024
1 parent 2924f5e commit 2f06bf9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 63 deletions.
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = function (api) {
api.cache(true);
return {
//https://github.com/babel/babel/discussions/13676#discussioncomment-1183149
compact: true,
presets: ['babel-preset-expo'],
plugins: [
'transform-inline-environment-variables',
Expand Down
14 changes: 10 additions & 4 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
const {getDefaultConfig} = require('expo/metro-config');
const path = require('path');

module.exports = (() => {
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot);
const config = getDefaultConfig(__dirname);
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot);

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

module.exports = (() => {
const {transformer, resolver} = config;

config.transformer = {
...transformer,
// For https://github.com/kristerkari/react-native-svg-transformer
babelTransformerPath: require.resolve('react-native-svg-transformer'),
};
config.resolver = {
...resolver,
// For nodejs-mobile
blockList: [/nodejs-assets\/.*/],
// For https://github.com/kristerkari/react-native-svg-transformer
assetExts: resolver.assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
};
Expand Down
59 changes: 0 additions & 59 deletions patches/react-native-svg-transformer+1.3.0.patch

This file was deleted.

0 comments on commit 2f06bf9

Please sign in to comment.