zoukankan      html  css  js  c++  java
  • 合并js文件minify实例

    将min目录放入项目中后,js中引入方式是:

    <script type="text/javascript" src="__PUBLIC__/min/?b=public&f=Js/Jquery/jquery-1.8.2.js,Js/Jquery/jquery-ui-1.9.2.custom.min.js"></script>

    如果用到分组的话,上面的就不合适了。

    分组实例:

    1.config.php

    $min_serveOptions['minApp']['allowDirs'] = array('//jsOne', '//jsTwo', '//jsThree', '//jsFour', '//jsFive', '//jsSix');

    2.groupsConfig.php

    return array(
        'jsOne' => array('//public/Js/redidai.js', '//public/Js/redidai.common.js', '//public/Js/redidai.login.js', '//public/Js/Jquery/jquery.cookie.js', '//public/Js/common.js', '//public/redidai/plan1.4/js/redidai.ajax.operate.js'),
        'jsTwo' => array('//public/Js/autocomplete/plugin/jquery-pre-build/ui/jquery.ui.core.js', '//public/Js/autocomplete/plugin/jquery-pre-build/ui/jquery.ui.widget.js', '//public/Js/autocomplete/plugin/jquery-pre-build/ui/jquery.ui.position.js', '//public/Js/autocomplete/plugin/jquery-pre-build/ui/jquery.ui.autocomplete.js'),
        'jsThree' => array('//public/Js/redidai.passport.js', '//public/Js/Jquery/formvalidator/formValidator-4.1.3.js', '//public/Js/Jquery/formvalidator/formValidatorRegex-4.1.3.js'),
        'jsFour' => array('//public/Js/hoverIntent.js', '//public/Js/superfish.js'),
        'jsFive' => array('//public/Js/Jquery/jquery-1.8.2.js', '//public/Js/Jquery/jquery-ui-1.9.2.custom.min.js'),
        'jsSix' => array('//public/Js/Jquery/jquery-ui-1.9.0.custom.min.js', '//public/Js/head.load.min.js', '//public/redidai/plan1.4/js/placeholder.js', '//public/Js/Jquery/jquery.cookies.js', '//public/Js/Jquery/jquery.tmpl.min.js'),
    );

    3.调用:

    <script type="text/javascript" src="__PUBLIC__/min/?g=jsFive"></script>

  • 相关阅读:
    BZOJ_3174_[Tjoi2013]拯救小矮人_贪心+DP
    BZOJ_1334_[Baltic2008]Elect_DP+语文题
    BZOJ_1858_[Scoi2010]序列操作_线段树
    BZOJ_1369_[Baltic2003]Gem_树形DP
    BZOJ_1705_[Usaco2007 Nov]Telephone Wire 架设电话线_DP
    BZOJ_2223_[Coci 2009]PATULJCI_主席树
    BZOJ_1800_[Ahoi2009]fly 飞行棋_乱搞
    BZOJ_1878_[SDOI2009]HH的项链_莫队
    Struts2自定义过滤器的小例子-入门篇
    JAVA程序员常用软件整理
  • 原文地址:https://www.cnblogs.com/xingmeng/p/3461216.html
Copyright © 2011-2022 走看看