我正在尝试使用自定义编译器(基于oc-template-react )设置OpenComponents。
我的组件的 package.json:
{
"name": "hi-there",
"description": "Hello World OC",
"version": "1.0.0",
"oc": {
"files": {
"data": "server.js",
"template": {
"src": "app.js",
"type": "oc-my-template"
}
},
"parameters": {
"name": {
"default": "World",
"description": "Your name",
"example": "Jane Doe",
"mandatory": false,
"type": "string"
}
}
},
"devDependencies": {
"oc-my-template-compiler": "*"
}
}
oc-my-template-compiler
已安装。打包工作正常,但我从注册表中收到以下错误:
{
code: "TEMPLATE_NOT_SUPPORTED"
error: "oc-my-template is not a supported oc-template"
name: "hi-there"
requestVersion: "1.0.0"
}
我想我应该用oc.registerTemplate注册模板,但我不确定我应该在哪里做。开发注册表不应该关心它吗?