umijs / babel-plugin-import

Modularly import plugin for babel.
3.15k stars 403 forks source link

与 babel 7 配合无效 #505

Open hasayake97 opened 3 years ago

hasayake97 commented 3 years ago

这是我的 .babelrc 配置 入口加载的是 dist/antd.less 使用方式为 组件按需加载

["import",
  {
      "libraryName": "antd",
      "style": true   // or 'css'
   }
]

babel v7.x webpack v4.x

codeGun123 commented 3 years ago

一样的问题

wangmeijian commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

ok2fly commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

if i use create-react-app my-app create a project with antd-mobile, how to use babel-plugin-import to make it work ?

TomatoDroid commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

该如何在webpack中使用?

cyt68 commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

王美健,why do you speak English?

wangmeijian commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

王美健,why do you speak English?

何方妖孽?东哥?

dAskyacc commented 3 years ago

+1 This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'. at File.addImport

王美健,why do you speak English?

何方妖孽?东哥?

我不做大哥好多年