forked from jpmonette/feed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
48 lines (45 loc) · 933 Bytes
/
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
46
47
48
import terser from "@rollup/plugin-terser";
import type { RollupOptions } from "rollup";
import dts from "rollup-plugin-dts";
import esbuild from "rollup-plugin-esbuild";
const pluginEsbuild = esbuild({
target: "es2020",
});
const pluginDts = dts();
const pluginTerser = terser({
compress: {
drop_console: true,
drop_debugger: true,
},
mangle: true,
format: {
comments: false,
},
});
const input = "./src/index.ts";
const outDir = "./lib";
export default [
{
input,
output: [
{
file: `${outDir}/index.mjs`,
format: "es",
},
{
file: `${outDir}/index.cjs`,
format: "cjs",
},
],
plugins: [pluginEsbuild, pluginTerser],
},
{
input,
output: [
{ file: `${outDir}/index.d.cts` },
{ file: `${outDir}/index.d.mts` },
{ file: `${outDir}/index.d.ts` },
],
plugins: [pluginDts],
},
] as RollupOptions[];