-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrollup.config.js
161 lines (157 loc) · 6.72 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* tslint:disable */
// PLUGINS
import babel from 'rollup-plugin-babel';
import typescript from 'rollup-plugin-typescript';
import commonjs from 'rollup-plugin-commonjs';
import sourceMaps from 'rollup-plugin-sourcemaps';
// TODO: Use this plugin on the production bundle, not on the module (check if intellisense breaks)
// import { terser } from 'rollup-plugin-terser';
import * as packageJSON from './package.json';
const commonPlugins = [
typescript({ tsconfig: './tsconfig.json' }),
commonjs({
include: 'node_modules/**',
}),
sourceMaps(),
// terser(),
babel({
exclude: 'node_modules/**',
extensions: ['ts', 'tsx'],
}),
];
// Needed for tree-shaking. Static list for now.
const componentList = {
// COMPONENTS
index: './src/index.ts',
adapt: './src/Adapt/index.ts',
alert: './src/Alert/index.ts',
autocomplete: './src/AutoComplete/index.ts',
avatar: './src/Avatar/index.ts',
badge: './src/Badge/index.ts',
button: './src/Button/index.ts',
card: './src/Card/index.ts',
collapse: './src/Collapse/index.ts',
dropdown: './src/DropDown/index.ts',
form: './src/Form/index.ts',
grid: './src/Grid/index.ts',
hero: './src/Hero/index.ts',
modal: './src/Modal/index.ts',
layout: './src/Layout/index.ts',
list: './src/List/index.ts',
menu: './src/Menu/index.ts',
popover: './src/PopOver/index.ts',
skeleton: './src/Skeleton/index.ts',
pagination: './src/Pagination/index.ts',
table: './src/Table/index.ts',
tabs: './src/Tabs/index.ts',
typography: './src/Typography/index.ts',
tooltip: './src/Tooltip/index.ts',
// THEME
theme: './src/theme/index.ts',
// UTILS
thememerge: './src/utils/index.ts',
// ICONS
addevent: './src/Icon/Icons/AddEvent.component.tsx',
arrowback: './src/Icon/Icons/ArrowBack.component.tsx',
arrowforward: './src/Icon/Icons/ArrowForward.component.tsx',
avataricon: './src/Icon/Icons/AvatarIcon.component.tsx',
avataroutline: './src/Icon/Icons/AvatarOutline.component.tsx',
barcode: './src/Icon/Icons/BarCode.component.tsx',
bulletlist: './src/Icon/Icons/BulletList.component.tsx',
calendar: './src/Icon/Icons/Calendar.component.tsx',
camera: './src/Icon/Icons/Camera.component.tsx',
cart: './src/Icon/Icons/Cart.component.tsx',
cashback: './src/Icon/Icons/CashBack.component.tsx',
cells: './src/Icon/Icons/Cells.component.tsx',
chat: './src/Icon/Icons/Chat.component.tsx',
check: './src/Icon/Icons/Check.component.tsx',
checksmall: './src/Icon/Icons/CheckSmall.component.tsx',
chevrondown: './src/Icon/Icons/ChevronDown.component.tsx',
chevrondownsmall: './src/Icon/Icons/ChevronDownSmall.component.tsx',
chevronleft: './src/Icon/Icons/ChevronLeft.component.tsx',
chevronleftsmall: './src/Icon/Icons/ChevronLeftSmall.component.tsx',
chevronright: './src/Icon/Icons/ChevronRight.component.tsx',
chevronrightsmall: './src/Icon/Icons/ChevronRightSmall.component.tsx',
chevronup: './src/Icon/Icons/ChevronUp.component.tsx',
chevronupsmall: './src/Icon/Icons/ChevronUpSmall.component.tsx',
clock: './src/Icon/Icons/Clock.component.tsx',
close: './src/Icon/Icons/Close.component.tsx',
closesmall: './src/Icon/Icons/CloseSmall.component.tsx',
commentmore: './src/Icon/Icons/CommentMore.component.tsx',
creditcard: './src/Icon/Icons/CreditCard.component.tsx',
crosshairs: './src/Icon/Icons/CrossHairs.component.tsx',
cut: './src/Icon/Icons/Cut.component.tsx',
disabled: './src/Icon/Icons/Disabled.component.tsx',
dislike: './src/Icon/Icons/Dislike.component.tsx',
download: './src/Icon/Icons/Download.component.tsx',
ellipses: './src/Icon/Icons/Ellipses.component.tsx',
ellipsesvertical: './src/Icon/Icons/EllipsesVertical.component.tsx',
envelope: './src/Icon/Icons/Envelope.component.tsx',
envelopeopen: './src/Icon/Icons/EnvelopeOpen.component.tsx',
error: './src/Icon/Icons/Error.component.tsx',
expand: './src/Icon/Icons/Expand.component.tsx',
gear: './src/Icon/Icons/Gear.component.tsx',
giftcard: './src/Icon/Icons/GiftCard.component.tsx',
hamburger: './src/Icon/Icons/Hamburger.component.tsx',
heart: './src/Icon/Icons/Heart.component.tsx',
heartoutline: './src/Icon/Icons/HeartOutline.component.tsx',
home: './src/Icon/Icons/Home.component.tsx',
info: './src/Icon/Icons/Info.component.tsx',
infooutline: './src/Icon/Icons/InfoOutline.component.tsx',
laptop: './src/Icon/Icons/Laptop.component.tsx',
lightning: './src/Icon/Icons/Lightning.component.tsx',
like: './src/Icon/Icons/Like.component.tsx',
listicon: './src/Icon/Icons/ListIcon.component.tsx',
lock: './src/Icon/Icons/Lock.component.tsx',
map: './src/Icon/Icons/Map.component.tsx',
marker: './src/Icon/Icons/Marker.component.tsx',
markeroutline: './src/Icon/Icons/MarkerOutline.component.tsx',
mobile: './src/Icon/Icons/Mobile.component.tsx',
news: './src/Icon/Icons/News.component.tsx',
pencil: './src/Icon/Icons/Pencil.component.tsx',
play: './src/Icon/Icons/Play.component.tsx',
plus: './src/Icon/Icons/Plus.component.tsx',
plussmall: './src/Icon/Icons/PlusSmall.component.tsx',
print: './src/Icon/Icons/Print.component.tsx',
question: './src/Icon/Icons/Question.component.tsx',
questionoutline: './src/Icon/Icons/QuestionOutline.component.tsx',
refresh: './src/Icon/Icons/Refresh.component.tsx',
retailmenotlogo: './src/Icon/Icons/RetailMeNotLogo.component.tsx',
sadface: './src/Icon/Icons/SadFace.component.tsx',
search: './src/Icon/Icons/Search.component.tsx',
share: './src/Icon/Icons/Share.component.tsx',
sliders: './src/Icon/Icons/Sliders.component.tsx',
star: './src/Icon/Icons/Star.component.tsx',
starhalf: './src/Icon/Icons/StarHalf.component.tsx',
staroutline: './src/Icon/Icons/StarOutline.component.tsx',
success: './src/Icon/Icons/Success.component.tsx',
successoutline: './src/Icon/Icons/SuccessOutline.component.tsx',
tag: './src/Icon/Icons/Tag.component.tsx',
upload: './src/Icon/Icons/Upload.component.tsx',
tagadd: './src/Icon/Icons/TagAdd.component.tsx',
};
export default {
input: componentList,
output: [
{
dir: './commonjs',
format: 'cjs',
sourcemap: true,
named: true,
chunkFileNames: 'anchor-[name]-[hash].js',
},
{
dir: './esm',
format: 'es',
sourcemap: true,
named: true,
chunkFileNames: 'anchor-[name]-[hash].js',
},
],
plugins: commonPlugins,
external: [
...Object.keys(packageJSON.dependencies || {}),
...Object.keys(packageJSON.peerDependencies || {}),
],
experimentalCodeSplitting: true,
};