Minifying code for PhoneGap App?

后端 未结 5 1282
逝去的感伤
逝去的感伤 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:17

    From my experience Javascript grows a lot more than html/css.

    From here: https://reactjs.org/docs/add-react-to-a-website.html

    Tip: Minify JavaScript for Production
    Before deploying your website to production, be mindful that unminifed JavaScript can significantly slow down the page for your users.
    ...
    If you don’t have a minification step for your scripts, here’s one way to set it up.

    Which takes to https://gist.github.com/gaearon/42a2ffa41b8319948f9be4076286e1f3

    In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

    Yes, it is recommended to minify.
    The 2nd link above has simple commands on how to minify, using terser npm package.

提交回复
热议问题