-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
63 lines (62 loc) · 1.59 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import { babel } from '@rollup/plugin-babel'
import alias from '@rollup/plugin-alias'
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import postcss from 'rollup-plugin-postcss'
import json from '@rollup/plugin-json'
import url from '@rollup/plugin-url'
import typescript from '@rollup/plugin-typescript'
import pkg from './package.json'
export default {
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
},
{
file: pkg.module,
format: 'esm',
sourcemap: true,
},
],
plugins: [
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
extensions: ['.js', '.ts', '.tsx'],
}),
alias({
entries: [
{ find: '@src', replacement: 'src' },
{ find: '@Styles', replacement: 'src/assets/styles' },
{ find: '@Components', replacement: 'src/components' },
{ find: '@Charts', replacement: 'src/components/charts' },
{ find: '@Cards', replacement: 'src/components/card' },
{ find: '@Table', replacement: 'src/components/table' },
],
}),
postcss({
includePaths: ['src/components', 'src/assets/styles'],
extensions: ['.css', '.scss', '.sass'],
}),
nodeResolve({
mainFields: ['browser', 'jsnext', 'module', 'main'],
}),
commonjs({ extensions: ['.js', '.ts', '.tsx'] }),
url(),
json(),
typescript(),
],
external: [
'react',
'react-dom',
'styled-components',
'd3',
'recharts',
'antd',
'typescript',
'tslib',
],
}