forked from janjakubnanista/downsample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
35 lines (33 loc) · 814 Bytes
/
rollup.config.js
File metadata and controls
35 lines (33 loc) · 814 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
import resolve from 'rollup-plugin-node-resolve';
import commonJS from 'rollup-plugin-commonjs';
import ts from '@wessberg/rollup-plugin-ts';
import { terser } from 'rollup-plugin-terser';
const IS_PRODUCTION = process.env.NODE_ENV === 'production';
const output = {
compact: IS_PRODUCTION,
exports: 'named',
sourcemap: true,
};
export default [{
input: 'src/index.ts',
output: [
{
...output,
file: 'dist/index.cjs.js',
format: 'cjs',
name: 'downsample',
},
{
...output,
file: 'dist/index.es.js',
format: 'es',
sourcemap: true,
},
],
plugins: [
ts({ transpiler: 'babel' }),
resolve({ browser: true }),
commonJS({ ignoreGlobal: true }),
IS_PRODUCTION ? terser({ compress: true, sourcemap: true }) : undefined,
],
}];