babel-plugin-import icon indicating copy to clipboard operation
babel-plugin-import copied to clipboard

在按需加载css的时候能否先判断lib下对应组件下是否存在style,如果不存在就不reqiuire css了

Open zhangchao828 opened this issue 8 years ago • 6 comments

比如有些组件就是纯逻辑的组件,没有写style,那么这个时候就会报错提示Module not found

zhangchao828 avatar Sep 21 '17 03:09 zhangchao828

+1

ssehacker avatar May 05 '18 16:05 ssehacker

+1

trexguo avatar Dec 30 '18 05:12 trexguo

+1,楼上1年前没人理,我来提个PR

hucheng91 avatar Jan 08 '19 11:01 hucheng91

@zhangchao828 @ssehacker style可以返回 函数

['import', { libraryName: '@qtt/hobbit', libraryDirectory: 'es', "style": (name) => { console.log('tag', name) if (name == ‘逻辑模块') { return false; } return ${name}/style; }

hucheng91 avatar Jan 08 '19 12:01 hucheng91

+1. It doesn't make sense.

chj-damon avatar Sep 03 '19 11:09 chj-damon

Same issue here. Already used

if (name == 'not-existing-path') {
  return false;
}

tigressbailey avatar Jul 22 '21 03:07 tigressbailey