babel-plugin-import
babel-plugin-import copied to clipboard
在按需加载css的时候能否先判断lib下对应组件下是否存在style,如果不存在就不reqiuire css了
比如有些组件就是纯逻辑的组件,没有写style,那么这个时候就会报错提示Module not found
+1
+1
+1,楼上1年前没人理,我来提个PR
@zhangchao828 @ssehacker style可以返回 函数
['import', {
libraryName: '@qtt/hobbit',
libraryDirectory: 'es',
"style": (name) => {
console.log('tag', name)
if (name == ‘逻辑模块') {
return false;
}
return ${name}/style;
}
+1. It doesn't make sense.
Same issue here. Already used
if (name == 'not-existing-path') {
return false;
}