-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
64 lines (63 loc) · 1.19 KB
/
rollup.config.js
File metadata and controls
64 lines (63 loc) · 1.19 KB
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
56
57
58
59
60
61
62
63
64
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const pkg = require("./package.json");
const year = new Date().getFullYear();
const bannerLong = `/**
* ${pkg.name}
*
* @copyright ${year} ${pkg.author}
* @license ${pkg.license}
* @version ${pkg.version}
*/`;
const defaultOutBase = { compact: true, banner: bannerLong, name: pkg.name };
const cjOutBase = { ...defaultOutBase, compact: false, format: "cjs", exports: "named" };
const esmOutBase = { ...defaultOutBase, format: "esm" };
export default [
{
external: [
"node:http",
"node:path",
"node:events",
"node:fs",
"node:fs/promises",
"node:module",
"node:url",
"jsonschema",
"mime-db",
"precise",
"tiny-etag",
"tiny-lru",
"tiny-coerce",
],
input: "./src/woodland.js",
output: [
{
...cjOutBase,
file: `dist/${pkg.name}.cjs`,
},
{
...esmOutBase,
file: `dist/${pkg.name}.js`,
},
],
},
{
external: [
"node:http",
"node:fs",
"node:module",
"node:path",
"node:url",
"mime-db",
"tiny-coerce",
"woodland",
],
input: "./src/cli.js",
output: [
{
...cjOutBase,
file: "dist/cli.cjs",
},
],
},
];