-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrollup.config.js
120 lines (114 loc) · 2.88 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
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import url from '@rollup/plugin-url';
import typescript from '@rollup/plugin-typescript';
import replace from 'rollup-plugin-replace';
import path from 'path';
import postcssimport from 'postcss-easy-import';
import cssnext from 'postcss-cssnext';
import vars from 'postcss-simple-vars';
import nested from 'postcss-nested';
import color from 'postcss-color-function';
import pkg from './package.json';
const variables = {
borderRadius: '4px',
z0: '0',
z1: '10',
z2: '20',
z3: '30',
z4: '40',
z5: '50',
z6: '60',
z7: '70',
z8: '80',
z9: '90',
transparent: 'rgba(255,255,255,0)',
white: '#ffffff',
black: '#000000',
primary: '#00D46A',
info: '#0BA8E0',
faded: '#DDDDDD',
error: '#FF0000',
fontColor: '#414D54',
// Colors to optimize
rafAttachedActivityAuthor: '#414D54',
rafActivityFooterBorder: '#E6F0F2',
rafCommentfieldBackground: '#F7F7F7', // lightest grey
rafCardBackground: '#F4F4F4', // lighter grey
rafCardBorder: '#A0B2B8', // grey
rafDropdownBackground: '#313E47', // dark grey
};
export default [
{
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
},
],
watch: {
chokidar: false,
},
external: [
'react-images',
'lodash',
'react-dropzone',
'url-parse',
'prop-types',
'@babel/runtime/regenerator',
'@babel/runtime/helpers/asyncToGenerator',
'@babel/runtime/helpers/objectWithoutProperties',
'@babel/runtime/helpers/toConsumableArray',
'@babel/runtime/helpers/objectSpread',
'@babel/runtime/helpers/extends',
'@babel/runtime/helpers/typeof',
'@babel/runtime/helpers/defineProperty',
'@babel/runtime/helpers/assertThisInitialized',
'@babel/runtime/helpers/inherits',
'@babel/runtime/helpers/getPrototypeOf',
'@babel/runtime/helpers/possibleConstructorReturn',
'@babel/runtime/helpers/createClass',
'@babel/runtime/helpers/classCallCheck',
],
plugins: [
typescript(),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
external(),
url(),
babel({
runtimeHelpers: true,
exclude: 'node_modules/**',
}),
commonjs(),
],
},
{
input: 'src/styles/index.js',
output: [
{
file: 'dist/index.css',
format: 'cjs',
},
],
plugins: [
postcss({
plugins: [
vars({ variables }),
postcssimport(),
cssnext({ warnForDuplicates: false }),
nested(),
color(),
],
modules: false,
extract: path.resolve('dist/index.css'),
minimize: true,
}),
],
},
];