generated from rdimascio/blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
58 lines (52 loc) · 974 Bytes
/
rollup.config.js
File metadata and controls
58 lines (52 loc) · 974 Bytes
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
/* eslint-disable import/no-anonymous-default-export */
import path from 'path';
import {uglify} from 'rollup-plugin-uglify';
import {getBabelOutputPlugin} from '@rollup/plugin-babel';
import pkg from './package.json';
const config = {
input: 'src/index.js',
plugins: [],
output: {
exports: 'default',
sourcemap: true
}
};
const umd = {
...config,
output: {
...config.output,
file: pkg.unpkg,
format: 'umd',
name: 'getAttributes'
},
plugins: [
...config.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
}
})
]
};
const web = {
...config,
output: [
{
...config.output,
file: pkg.main,
format: 'cjs'
},
{
...config.output,
file: pkg.module,
format: 'es'
}
]
};
export default [umd, web];