antd-tools icon indicating copy to clipboard operation
antd-tools copied to clipboard

关于打包有几个问题想请教一下

Open pandaCure opened this issue 5 years ago • 1 comments

第一个: build UMD时 为什么在 webpack配置里面去增加babel-plugin-import 不太明白? 第二个: ts编译之后已经输出cjs es代码(可以直接运行)了 为什么还需要babel转一下 ?

pandaCure avatar Nov 25 '19 07:11 pandaCure

Modularly import plugin for babel.

https://github.com/ant-design/babel-plugin-import

import { Button } from 'antd';
ReactDOM.render(<Button>xxxx</Button>);

      ↓ ↓ ↓ ↓ ↓ ↓

var _button = require('antd/lib/button');
require('antd/lib/button/style/css');
ReactDOM.render(<_button>xxxx</_button>);

jhoneybee avatar May 26 '20 12:05 jhoneybee