-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrollup.config.ts
45 lines (42 loc) · 1.02 KB
/
rollup.config.ts
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
44
45
/* eslint-disable import/no-extraneous-dependencies */
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require('./package.json');
const config = [
{
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
sourcemap: true,
},
{
file: pkg.module,
format: 'esm',
sourcemap: true,
},
],
external: Object.keys(pkg.dependencies),
plugins: [typescript(), resolve(), terser({ output: { comments: false } })],
},
{
input: 'src/index.umd.ts',
output: {
file: pkg.browser,
format: 'umd',
sourcemap: true,
name: 'readEnv',
},
plugins: [
typescript(),
commonjs(),
resolve(),
terser({ output: { comments: false } }),
],
},
];
export default config;