s.diandao.org
v0.1.0
Published
diandao静态资源包
Downloads
290
Readme
##点到静态资源包(http://s.diandao.org)
##Dependences NodeJS 安装node环境
###图片压缩依赖 CentOS yum install pngquant jpegoptim -y
MAC brew brew install pngquant jpegoptim
grunt-cli
全局安装grunt命令行客户端
$ npm instal grunt-cli -g
安装依赖 依赖配置文件见 package.json 切换至当前目录 $ npm install
打包配置
grunt-config.js
##执行任务(需当前目录下) grunt package 基于newer缓存配置, 只作用于新增改文件. 执行打包任务: css,js压缩, 相关文件copy至package_dir,增量打包新增和修改的文件
grunt package-flush 清空package缓存, 执行后配合 grunt package, 能重新覆盖打包整个项目. 如果更改了编译配置文件, 需要重新编译全部文件, 可执行该命令清除newer文件缓存
grunt package-clean (危险) 清空整个项目文件, 再执行grunt package重新打包, 能清掉冗余的文件,与开发环境同步. 但由于打包整个项目需要一定的时间, 清空目录后, 打包期间如果还有网络请求, 可能导致部分文件404
grunt debug debug模式, 包含dev任务, 主要用于任何配置脚本编写时的nodejs调试
grunt dev 开发模式, 前端开发在编辑 .less 文件时,会自动编译 .css文件
grunt lessc 编译项目中已修改的.less文件为.css文件
##编译说明 .less 文件 编译同名.css文件于同目录下, 文件头使用//!.nolessc来忽略该文件的编译
hi