-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.ts
More file actions
44 lines (42 loc) · 1.17 KB
/
rollup.config.ts
File metadata and controls
44 lines (42 loc) · 1.17 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
import typescript from "@rollup/plugin-typescript";
import json from "@rollup/plugin-json";
import { typescriptPaths } from "rollup-plugin-typescript-paths";
import dts from "rollup-plugin-dts";
import { join } from "path";
import { codecovRollupPlugin } from "@codecov/rollup-plugin";
const outputDir = join(import.meta.dirname, "/dist/npm/");
export default [
{
input: {
index: "src/index.ts",
},
output: [
{
dir: join(outputDir, "es"),
format: "es",
},
{
dir: join(outputDir, "cjs"),
format: "cjs",
},
],
external: ["yargs/yargs", "yargs/helpers", "fs/promises", "xml-js"],
plugins: [
json(),
typescript({ tsconfig: "./tsconfig.json" }),
codecovRollupPlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "package",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
},
{
input: "src/index.ts",
output: [
{ file: `${outputDir}/es/types.d.ts`, format: "es" },
{ file: `${outputDir}/cjs/types.d.ts`, format: "cjs" },
],
plugins: [json(), typescriptPaths({ preserveExtensions: true }), dts()],
},
];