-
Notifications
You must be signed in to change notification settings - Fork 7
/
rollup.config.js
39 lines (37 loc) · 980 Bytes
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import typescript from 'rollup-plugin-typescript';
// import { terser } from 'rollup-plugin-terser';
const plugins = [
typescript({
exclude: 'node_modules/**',
typescript: require('typescript'),
}),
// terser()
]
module.exports = {
input: 'src/lib/index.ts',
external: ['react', 'antd/lib/table/Table', 'antd', '@ant-design/icons', 'react-beautiful-dnd'],
plugins,
output: [{
file: "dist/index.js",
format: 'cjs',
// 添加globals
globals: {
react: 'React',
antd: 'antd',
'antd/lib/table/Table': 'antd/lib/table/Table',
'@ant-design/icons': '@ant-design/icons',
'react-beautiful-dnd': 'react-beautiful-dnd',
}
}, {
file: "es/index.js",
format: 'es',
// 添加globals
globals: {
react: 'React',
antd: 'antd',
'antd/lib/table/Table': 'antd/lib/table/Table',
'@ant-design/icons': '@ant-design/icons',
'react-beautiful-dnd': 'react-beautiful-dnd',
}
}]
};