zoukankan      html  css  js  c++  java
  • css压缩(一)

    基于require.js的压缩,至于require.js,网上有比较权威的解说

    RequireJS进阶(一)

    RequireJS进阶(二)

    RequireJS进阶(三)

    目前我所做的项目是把各个模块下的分css,压缩到一个统一的resource目录下统一管理。本项目用的是nodejs,因为这一版本里已经集成了require.js,所以不需引用,require.js的压缩库其实是r.js,所以还需要引用一下,然后通过dos命令写一个bat文件

    @echo off
    node r.js -o cssIn=html_Report/css/main.css out=resources/default/html_report_main.css optimizeCss=standard
    node r.js -o cssIn=html_Report/css/detail.css out=resources/default/html_report_detail.css optimizeCss=standard
    node r.js -o cssIn=html_Report/css/structure.css out=resources/default/html_report_structure.css optimizeCss=standard
    node r.js -o cssIn=html_Notice/css/main.css out=resources/default/html_notice_main.css optimizeCss=standard

    //下面这段相当于一个日子文件

    echo CACHE MANIFEST > html_Report/report.appcache//创建
    echo,# %date%-%time% >>html_Report/report.appcache//追加
    echo,NETWORK:>>html_Report/report.appcache
    echo,*>>html_Report/report.appcache
    echo,CACHE:>>html_Report/report.appcache
    echo,/resources/default/html_report_structure.css>>html_Report/report.appcache
    echo,/resources/default/html_report_main.css>>html_Report/report.appcache
    echo,/resources/default/html_report_detail.css>>html_Report/report.appcache
    echo,/resources/default/images/tab_sprite.png>>html_Report/report.appcache
    echo,/resources/default/images/attachment_sprite.gif>> html_Report/report.appcache
    echo,/js/seajs2.0/sea.js>>html_Report/report.appcache

    exit

  • 相关阅读:
    git客户端
    Autowired注解的妙用---在Controller里的构造函数里获取需要注入的对象
    面向对象的理解
    改变对update的做法
    时间戳与日期相互转换
    Git随记
    json数据传输有感
    Mybatis的批量CRUD
    并发与线程有感
    dpkg --info
  • 原文地址:https://www.cnblogs.com/yichengbo/p/3643544.html
Copyright © 2011-2022 走看看