-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
111 lines (109 loc) · 2.38 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
import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import external from 'rollup-plugin-peer-deps-external';
import resolve from 'rollup-plugin-node-resolve';
import postcss from 'rollup-plugin-postcss';
import postcssImport from 'postcss-import';
import postcssEasyImport from 'postcss-easy-import';
import postcssCustomMedia from 'postcss-custom-media';
import postcssPresetEnv from 'postcss-preset-env';
import postcssNested from 'postcss-nested';
import pkg from './package.json';
export default [{
input: 'src/css/index.css',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
sourcemap: true
}
],
plugins: [
postcss({
extensions: ['.css'],
export: './dist',
sourceMap: true,
extract: true,
modules: {
scopeBehaviour: 'global'
},
plugins: [
postcssEasyImport({
prefix: '_'
}),
postcssImport,
postcssCustomMedia,
postcssPresetEnv({
browsers: ['last 2 versions', '> 5%'],
features: {
customProperties: {
preserve: true
}
}
}),
postcssNested
]
})
]
}, {
input: 'src/index.tsx',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
sourcemap: true
},
{
file: pkg.module,
format: 'es',
exports: 'named',
sourcemap: true
}
],
plugins: [
external(),
resolve(),
typescript({
exclude: '**/__tests__/**',
clean: true,
rollupCommonJSResolveHack: true
}),
commonjs({
include: ['node_modules/**'],
namedExports: {
'node_modules/react/react.js': [
'Children',
'Component',
'createElement'
],
'node_modules/react-dom/index.js': ['render'],
'node_modules/prop-types/index.js': [
'any',
'array',
'bool',
'func',
'number',
'object',
'string',
'node',
'element',
'symbol',
'elementType',
'instanceOf',
'oneOf',
'oneOfType',
'arrayOf',
'objectOf',
'shape',
'exact'
],
'node_modules/tlite/index.js': [
'show',
'hide'
]
}
})
]
}];