-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
38 lines (35 loc) · 971 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
38
// https://gist.github.com/aleclarson/9900ed2a9a3119d865286b218e14d226
import typescript from '@rollup/plugin-typescript';
import dts from "rollup-plugin-dts";
const input = "src/index.ts";
const bundleBasename = "bundle";
const external = ["cheerio", "htmlparser2", "turndown", "string-width"];
export default [
{
plugins: [typescript()],
input: input,
output: [
{
file: `dist/cjs/${bundleBasename}.js`,
format: "cjs",
sourcemap: true,
interop: "auto",
},
{
file: `dist/mjs/${bundleBasename}.js`,
format: "es",
sourcemap: true,
},
],
external: external,
},
{
plugins: [dts()],
input: input,
output: {
file: `dist/types/${bundleBasename}.d.ts`,
format: "es",
},
external: external,
},
];