2015/04/16

uglify你的cordova/ionic js檔



使用 cordova/ionic 這一類的 webapp platform 缺點就是你的 source code 都會被人看光啦~~

一般在 web 上我們可以使用 UglifyJS 去"醜化/混淆"你的 js 讓人不易閱讀

那在 cordova/ionic 該怎麼辦咧????



有人將 UglifyJS 整合到 cordova 上了 -- 那就是 Cordova Uglify

首先切換到你 ionic project 的 root

1. 安裝 Cordova Uglify
```
npm install cordova-uglify
```

2. 給予uglify.js執行權限
```
chmod +x hooks/after_prepare/uglify.js
```

3. build apk 查看結果
```
ionic build android
```

現在看看你的 js 檔是不是變得比較難閱讀了呢!!




Reference:
http://blog.ionic.io/minifying-your-source-code/

1 則留言:

  1. Woori Casino No Deposit Bonus 2021 | Free Play in Demo
    Woori Casino offers a variety of free 출장안마 spins and no deposit septcasino.com bonuses, as well https://septcasino.com/review/merit-casino/ as regular https://octcasino.com/ promotions. As you febcasino.com can't claim this offer without being registered

    回覆刪除