Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 996 Bytes

index.md

File metadata and controls

32 lines (24 loc) · 996 Bytes

Handler

执行echo "export function compile() {}" >> your_handler.js即可快速创建一个Handler。 虽然他什么功能也没有。

只需要在文件中export一个命名为compile的函数,就可以作为mili的Handler。 compile函数的具体出入参数如下:

export type Compile = (dist: Path, src: Path, filepath: Path, resource: Map<string, any>, options: Record<string, any>) => Syncable<Path | void>

函数的参数说明

key description
dist 存放项目的文件目录
src 存放模板的文件夹目录
filepath 模板文件的相对地址
resource 资源数据
options 配置参数

内置hadnler