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

chore(cli): remove tips with production

上级 c752e62e
......@@ -63,11 +63,16 @@ function generateAutoComponentsCode (autoComponents, dynamic = false) {
// 统一转换为驼峰命名
name = name.replace(/-(\w)/g, (_, str) => str.toUpperCase())
if (dynamic) {
components.push(`'${name}': function(){return import(/* webpackChunkName: "${getWebpackChunkName(source)}" */'${source}')}`)
components.push(
`'${name}': function(){return import(/* webpackChunkName: "${getWebpackChunkName(source)}" */'${source}')}`
)
} else {
components.push(`'${name}': require('${source}').default`)
}
})
if (process.env.NODE_ENV === 'production') {
return `var components = {${components.join(',')}}`
}
return `var components;
try{
components = {${components.join(',')}}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册