-
Notifications
You must be signed in to change notification settings - Fork 24.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minification breaks certain libraries #9711
Comments
Which libraries and which lines break? |
The current minifier is Uglify (may change to Babili later) so if you can figure out how to tell Uglify not to minify certain functions that would probably work for you. |
@ide Is there a way to generate a non-minified apk with react-native? |
Grep through the build process searching for |
In the end, we solved this by disabling mangling:
in We haven't found a nice way to commit this into version control yet. |
@facebook-github-bot label Icebox |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/minification-breaks-certain-libraries ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a PR with a fix. |
@facebook-github-bot close |
@charpeni tells me to close this issue. If you think it should still be opened let us know why. |
@yogiben you might be interested in patch-package for future situations like this. I use it to prevent mangling myself :-) |
Edit: Path changed again, see the comment below by @jackylimel
If you're using diff --git a/node_modules/metro-bundler/src/JSTransformer/worker/minify.js b/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
index 3f61ce9..4927afb 100644
--- a/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
+++ b/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
@@ -46,10 +46,11 @@ function minify(inputCode, inputMap) {
fromString: true,
inSourceMap: inputMap,
outSourceMap: true,
+ mangle: false,
output: UGLIFY_JS_OUTPUT_OPTIONS });
}
module.exports = {
noSourceMap,
- withSourceMap };
\ No newline at end of file
+ withSourceMap }; |
The file path mentioned here: #9711 (comment) is changed. It should be:
|
We're using a library in our Android RN app.
It works fine in dev, but breaks once minified.
Is there a way to skip minification of certain files?
The text was updated successfully, but these errors were encountered: