-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.ts
45 lines (42 loc) · 1.03 KB
/
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
/*
* @Author: {zhengzhuang}
* @Date: 2022-07-14 18:09:28
* @LastEditors: {zhengzhuang}
* @LastEditTime: 2022-10-24 18:27:00
* @Description: In User Settings Edit
*/
import typescript from "typescript";
import json from "@rollup/plugin-json";
import { terser } from "rollup-plugin-terser";
import typescript2 from "rollup-plugin-typescript2";
import nodeResolve from "@rollup/plugin-node-resolve";
import { dependencies } from "./package.json";
const external = Object.keys(dependencies || "");
const globals = external.reduce((prev, current) => {
const newPrev = prev;
newPrev[current] = current;
return newPrev;
}, {});
export default {
input: "./lib/cli.ts",
output: {
file: "./dist/cli.js",
format: "cjs",
// banner: "#!/usr/bin/env node",
globals,
},
external,
plugins: [
typescript2({
exclude: "node_modules/**",
useTsconfigDeclarationDir: true,
typescript,
tsconfig: "./tsconfig.json",
}),
json(),
terser(),
nodeResolve({
preferBuiltins: true,
}),
],
};