-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
37 lines (35 loc) · 932 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
import path from 'path';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import pkg from './package.json';
const input = './src/index.ts';
const external = ['react'];
export default [
// CommonJS (for Node)
{
input,
external,
plugins: [resolve(), commonjs(), typescript()],
output: { dir: path.dirname(pkg.main), format: 'cjs', sourcemap: true },
},
// ES module (for bundlers) build.
{
input,
external,
plugins: [resolve(), commonjs(), typescript()],
output: { dir: path.dirname(pkg.module), format: 'es', sourcemap: true },
},
// browser-friendly UMD build
{
input,
external,
plugins: [resolve(), commonjs(), typescript()],
output: {
name: 'reactBreakpoints',
dir: path.dirname(pkg.unpkg),
format: 'umd',
sourcemap: true,
},
},
];