This repository was archived by the owner on Oct 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
42 lines (41 loc) · 1.35 KB
/
rollup.config.js
File metadata and controls
42 lines (41 loc) · 1.35 KB
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
import babel from '@rollup/plugin-babel'
import flow from 'rollup-plugin-flow'
import path from 'path'
import resolve from 'rollup-plugin-node-resolve'
import { terser } from 'rollup-plugin-terser'
export default [
{
external: ['react', 'styled-components'],
input: `${path.resolve(__dirname, 'src', 'index.js')}`,
output: {
exports: 'named',
file: `${path.resolve(__dirname, 'bundle.js')}`,
format: 'cjs'
},
plugins: [
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: ['@babel/preset-flow', '@babel/preset-react'],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-spread',
'@babel/plugin-transform-destructuring',
'@babel/plugin-transform-parameters',
'@babel/plugin-transform-block-scoping',
'@babel/plugin-transform-computed-properties',
'@babel/plugin-transform-template-literals',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining'
],
babelHelpers: 'bundled'
}),
flow({ all: true }),
resolve(),
terser()
]
}
]