forked from draft-js-plugins/draft-js-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 858 Bytes
/
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
import path from 'path';
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
const input = './src/index.js';
const external = id => !id.startsWith('.') && !path.isAbsolute(id);
export default [
{
input,
output: {
format: 'cjs',
file: './lib/index.cjs.js',
exports: 'named',
},
external,
plugins: [nodeResolve(), babel({ rootMode: 'upward' })],
},
{
input,
output: {
format: 'esm',
file: './lib/index.esm.js',
},
external,
plugins: [
nodeResolve(),
babel({
rootMode: 'upward',
plugins: [
[
'babel-plugin-transform-rename-import',
{
replacements: [{ original: 'lodash', replacement: 'lodash-es' }],
},
],
],
}),
],
},
];