question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use react-native-obfuscating-transformer with multiple transformers/resolvers

See original GitHub issue

I’m trying to add multiple resolvers and transformers using metro for my react native project, how do I combine them and obfuscate the code.

I am using metro-babel-transformer and react-native-svg-transformer

var upstreamTransformer = require("metro-babel-transformer");
var svgTransformer = require("react-native-svg-transformer");

module.exports.transform = function({ src, filename, options }) {
if (filename.endsWith(".svg")) {
    return svgTransformer.transform({ src, filename, options });
  }  else {
    return upstreamTransformer.transform({ src, filename, options });
  }
};

My transformer.js look like this

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:14
  • Comments:5

github_iconTop GitHub Comments

1reaction
Ttecscommented, Jun 21, 2022

I had the same problem.instead of using react-native-obfuscating-transformer I used obfuscator-io-metro-plugin

https://stackoverflow.com/questions/72695239/configure-react-native-obfuscating-transformer-and-react-native-svg-transformer/72698465#72698465

0reactions
xhirazicommented, Mar 7, 2022

@grit96 @benduongquangmobile

follow this to resolve

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure react-native-obfuscating-transformer and react ...
I want to use react-native-svg-transformer and react-native-obfuscating-transformer.but when configuring it using the merge config method ...
Read more >
@inoueyuworks/react-native-obfuscating-transformer - npm
Defines what the first pass of code transformation is. If you don't use a custom transformer already, you don't need to set this...
Read more >
Configure multiple transformers/resolvers using metro-React ...
Coding example for the question Configure multiple transformers/resolvers using metro-React Native.
Read more >
Parcel.js
import {Transformer} from '@parcel/plugin'; export default new Transformer({ async transform({asset}) { let source = await asset.getCode(); let sourceMap = ...
Read more >
inoueyuworks/react-native-obfuscating-transformer - Snyk
Obfuscating transformer for react-native For more information about how to use this package see README · Ensure you're using the healthiest npm packages...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found