ionic-optimizer

2019-07-13 admin

ionic-optimizer是什么

什么是ionic-optimizer,The ionic hook that minimises application sources

ionic-optimizer使用教程帮助文档

Ionic optimizer

A small hook for ionic ~1.2 application, that grabs sources you use and minifies them into small bundle. Influenced by cordova-uglify

Install

npm install ionic-optimizer --save-dev

And then add executable permissions to 020_ionic_optimizer.js under your after_prepare folder

chmod +x hooks/after_prepare/020_ionic_optimizer.js

Usage

For basic usage just wrap your vendor files with

<!-- build:js vendors.js -->
<script src="lib/ionic/js/ionic.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular-animate/angular-animate.js"></script>
<script src="lib/angular-sanitize/angular-sanitize.js"></script>
<script src="lib/angular-ui-router/release/angular-ui-router.js"></script>
<script src="lib/ionic/js/ionic-angular.js"></script>
<!-- endbuild -->

And app’s source files with

<!-- build:js app.js -->
<script src="js/app.js"></script>
<script src="js/config.js"></script>
<!-- endbuild -->

Limitations

As this hook is in stage of deep development, there’s no flexible customisation available right now. But is on the way. The main restriction is to persist default project structure.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-69618.html

文章标题:ionic-optimizer

回到顶部