提交 d67ae576 编写于 作者: fxy060608's avatar fxy060608

chore(cli): add tips (easycom)

上级 f29da380
......@@ -68,7 +68,19 @@ function generateAutoComponentsCode (autoComponents, dynamic = false) {
components.push(`'${name}': require('${source}').default`)
}
})
return `var components = {${components.join(',')}}`
return `var components;
try{
components = {${components.join(',')}}
}catch(e){
if(e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('.vue') !== -1){
console.error(e.message)
console.error('1. 排查组件名称拼写是否正确')
console.error('2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom')
console.error('3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件')
} else {
throw e
}
}`
}
function compileTemplate (source, options, compile) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册