ant design - huge imports

后端 未结 7 1228
北恋
北恋 2020-12-24 11:56

I\'m using ant design library for my react application.

And I\'ve faced with huge imports, that hurts my bundle (currently 1.1 mb in minified version because of ant-

相关标签:
7条回答
  • 2020-12-24 12:28

    Issue which caused large bundle size has been fixed in Ant Design 4.0.

    Quoting from the release announcement.

    Smaller size

    In antd @ 3.9.0, we introduced the svg icon ([Why use the svg icon?] ()). The icon API using the string name cannot be loaded on demand, so the svg icon file is fully introduced, which greatly increases the size of the packaged product. In 4.0, we adjusted the icon usage API to support tree shaking, reducing the default package size of Antant by about 150 KB (Gzipped).

    In order to install Ant Design 4 you have to do following

    npm install antd@4.0.0-rc.1
    // or  in yarn
    yarn add antd@4.0.0-rc.1
    
    0 讨论(0)
提交回复
热议问题