知识指引: http://www.yiiframework.com/doc-2.0/guide-structure-assets.html
1. 工具准备
- JDK
- JS 压缩工具: Closure Compiler
(https://developers.google.com/closure/compiler)
- CSS 压缩工具: YUI Compressor
(http://yui.github.io/yuicompressor/)
下载后用命令行测试运行正常
java -jar E:/Software/MyTools/closure-compiler.jar --js
yii.activeForm.js --js_output_file yii.activeForm.min.js
java -jar E:/Software/MyTools/yuicompressor.jar --type css
font-awesome.css -o font-awesome.min.css
2 在项目下命令行生成要定义的assets 模板
yii asset/template assets.php
3 修改里面相关路径和定义, 完成。