Home  >  Q&A  >  body text

javascript - The js code obfuscated by uglify cannot be executed in the webview of ios

As the title states, the js code obfuscated by uglify cannot be executed in the webview of ios.

Due to the need for encryption and obfuscation before the company's products were launched, I used webpack -p to compress a piece of very simple js and threw it to the ios engineer, and then I was told that all the js was invalid.

Webview needs to be configured separately? Or does it not support uglify and future codes at all? consult

世界只因有你世界只因有你2635 days ago884

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-07-05 11:06:12

    Sorry, I found the problem. Before webpack -p, I wrote var $=require('jquery.min.js'); in main.js. This way of writing
    may be because .min.js has been uglified. As a result, the webview cannot be used after being confused again..
    Just remove this dependency

    reply
    0
  • 迷茫

    迷茫2017-07-05 11:06:12

    There shouldn’t be such a problem. At that time, I made the webview version of the app with iOS and Android. At that time, the js was compressed by r.js. It can be used on all three platforms

    reply
    0
  • Cancelreply