-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrollup.config.js
55 lines (54 loc) · 1.19 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";
import { terser } from "rollup-plugin-terser";
import dts from "rollup-plugin-dts";
import glob from "glob";
import path from "path";
export default [
{
input: "./src/index.js",
output: [
{
dir: "./lib/esm/",
format: "esm",
preserveModules: true,
sourcemap: true,
},
{
name: "vcard4",
file: "./lib/umd/index.js",
format: "umd",
sourcemap: true,
},
{
file: "./dist/index.esm.min.js",
format: "esm",
sourcemap: true,
plugins: [terser()],
},
{
name: "vcard4",
file: "./dist/index.umd.min.js",
format: "umd",
sourcemap: true,
plugins: [terser()],
},
],
plugins: [resolve(), babel({ babelHelpers: "bundled" })],
},
{
input: Object.fromEntries(
glob
.sync("types/**/*d.ts")
.map((file) => [
path.relative("types/src", file.replace(/\.d\.ts$/, "")),
file,
])
),
output: {
dir: "./lib/esm/",
format: "esm",
},
plugins: [resolve(), dts()],
},
];