Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pandaCure opened this issue Nov 25, 2019 · 1 comment
Open

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

pandaCure opened this issue Nov 25, 2019 · 1 comment

Comments

@pandaCure
Copy link

pandaCure commented Nov 25, 2019

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

@pandaCure pandaCure changed the title build umd有一个疑问 关于打包有几个问题想请教一下 Nov 25, 2019
@jhoneybee
Copy link

jhoneybee commented May 26, 2020

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>);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants