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

feat(cli): add usingAutoImportComponents

上级 91ea409e
......@@ -321,11 +321,17 @@ if (
require('@dcloudio/uni-cli-shared/lib/cache').restore()
}
}
process.UNI_AUTO_COMPONENTS = [{
pattern: new RegExp('uni-(.*)'),
replacement: '@/components/uni-$1/uni-$1.vue'
}]
// 组件自动导入配置
process.UNI_AUTO_COMPONENTS = []
const usingAutoImportComponents = pagesJsonObj.usingAutoImportComponents
if (usingAutoImportComponents) {
Object.keys(usingAutoImportComponents).forEach(pattern => {
process.UNI_AUTO_COMPONENTS.push({
pattern: new RegExp(pattern),
replacement: usingAutoImportComponents[pattern]
})
})
}
runByHBuilderX && console.log(`正在编译中...`)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册