多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 静态资源 [TOC] 静态资源的类型可以自己定义 通过在根包composer.json中配置extra字段来控制对应类型的静态资源应该安装到哪个路径,**{$name}**为静态资源包的名字**(mokuyu/static)** static为名字 下面在根包中定义两种类型包处理方法 根包composer.json ``` json "extra": { "branch-alias": { "dev-master": "1.0.x-dev" }, "installer-types": ["asset", "asset-public"], "installer-paths": { "web/public/{$name}/": ["type:asset-public"], "web/public/asset/{$name}/": ["type:asset"] } } ``` ## asset-public类型 composer.json格式: ``` json { "name": "asset/static", "type": "asset-public", "license": "MIT", "minimum-stability": "dev", "authors": [ { "name": "mokuyu", "email": "735579768@qq.com" }], "require": { "mokuyu/ank-installers-extender": "1.0.x-dev" }, "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } } } ``` 这个包的文件会被放在 web/public/static这个上目录下面 ## asset类型包格式 composer.json格式: ``` json { "name": "asset/plugin", "type": "asset", "license": "MIT", "minimum-stability": "dev", "authors": [ { "name": "mokuyu", "email": "735579768@qq.com" }], "require": { "mokuyu/ank-installers-extender": "1.0.x-dev" }, "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } } } ```