Minifying code for PhoneGap App?

后端 未结 5 1288
逝去的感伤
逝去的感伤 2021-02-05 04:08

I am currently starting to build an PhoneGap application, I know the advantages of minifying code for browsers already. However, I was wondering if it was worth minifying my HTM

5条回答
  •  遇见更好的自我
    2021-02-05 04:39

    Well tickle my feet and call me grandma, but I have been minifying the javascript for my phoneGap app, and it most certainly improves performance.

    Of course there is barely any difference in terms of the size of the application package. So the one time that a user downloads and installs the app, there is no real gain from minifying.

    But every time the user runs the app, having minified javascript does make a difference. Even though the file is local, it still needs to be loaded into the 'browser', and smaller files are loaded faster and will thus start executing earlier.

    And chances are you'll have a lot of javascript since most apps want to "do" something instead of just providing passive HTML content.

    I'm considering minifying the phonegap.js file itself too. Any thoughts on that are highly appreciated.

提交回复
热议问题