码迷,mamicode.com
首页 > 其他好文 > 详细

babel-plugin-import配置babel按需引入antd模块

时间:2020-05-10 20:48:35      阅读:451      评论:0      收藏:0      [点我收藏+]

标签:rar   安装   css   npm   package   library   directory   添加   bsp   

安装yarn add babel-plugin-import

运行  npm run eject 

打开package.json文件

  "babel": { 

    "presets": [

      "react-app" 

    ]

添加配置

  

"babel": {
    "presets": [
      "react-app"
    ],
    "plugins":
    [
      [
        "import",
        {
          "libraryName": "antd",
          "libraryDirectory": "es",
          "style": "css"
        }
      ]
    ]
  }

babel-plugin-import配置babel按需引入antd模块

标签:rar   安装   css   npm   package   library   directory   添加   bsp   

原文地址:https://www.cnblogs.com/zpsylgdx/p/12864673.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!