abbasfreestyle / react-native-af-video-player

MIT License
381 stars 289 forks source link

Uglify-JS removes fn-names #44

Open chrstnwhlrt opened 6 years ago

chrstnwhlrt commented 6 years ago

When compiling the player using react-native and minify enabled the minifier removes (default option) all function names. This leads to an issue using the fullscreen scrolling view:

  1. Compile without (!) --minify

  2. Start fullscreen within provided scrollview => Working

  3. Compile with --minify

  4. Start fullscren within provided scrollview => NOT working

Quickfix: Disable function name mangling inside the minifier node module:

In node_modules/uglifyjs-webpack-plugin/dist/uglify/minify.js

...
function minify(inputCode, inputMap) {
  const result = uglify.minify(inputCode, {
  keep_fnames: false
...
abbasfreestyle commented 6 years ago

Hi @christian667,

I haven't tested this with uglify. Did you have any luck finding a similar issue raised with uglify + react native?