# 静态资源
[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"
}
}
}
```