-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
60 lines (55 loc) · 1.17 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
/* eslint-disable import/no-anonymous-default-export, import/no-extraneous-dependencies */
import path from 'path';
import {uglify} from 'rollup-plugin-uglify';
import commonJS from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import {getBabelOutputPlugin} from '@rollup/plugin-babel';
const baseConfig = {
plugins: [
getBabelOutputPlugin({
configFile: path.resolve(__dirname, '.babelrc'),
allowAllFormats: true
}),
uglify({
compress: {
pure_getters: true, // eslint-disable-line camelcase
unsafe: true,
unsafe_comps: true // eslint-disable-line camelcase
}
})
],
output: {
exports: 'default',
format: 'umd',
name: 'brands'
},
sourceMap: true
};
const libConfig = {
...baseConfig,
input: [
path.resolve(__dirname, 'src/index.js')
],
output: {
...baseConfig.output,
file: 'dist/brands.js'
}
};
const iconsConfig = {
...baseConfig,
input: [
path.resolve(__dirname, 'src/icons.js')
],
output: {
...baseConfig.output,
file: 'dist/icons.js'
},
plugins: [
nodeResolve(),
commonJS({
include: 'node_modules/**'
}),
...baseConfig.plugins
]
};
export default [libConfig, iconsConfig];