forked from smucode/react-world-flags
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrollup.config.mjs
More file actions
43 lines (42 loc) · 913 Bytes
/
rollup.config.mjs
File metadata and controls
43 lines (42 loc) · 913 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
import { babel } from '@rollup/plugin-babel'
import image from '@rollup/plugin-image'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import sourcemaps from 'rollup-plugin-sourcemaps'
export default [
{
input: 'src/index.js',
output: {
dir: './dist/esm',
format: 'esm',
exports: 'named',
preserveModules: true,
sourcemap: true
},
plugins: [
resolve(),
image(),
babel({ babelHelpers: 'bundled' }),
commonjs(),
json(),
sourcemaps()
]
},
{
input: 'src/index-cjs.js',
output: {
file: './dist/cjs/index.js',
format: 'cjs',
sourcemap: true
},
plugins: [
resolve(),
image(),
babel({ babelHelpers: 'bundled' }),
commonjs(),
json(),
sourcemaps()
]
}
]