-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
43 lines (40 loc) · 1.05 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
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import sourcemap from "rollup-plugin-sourcemaps";
import typescript from "rollup-plugin-typescript2";
import common from "@rollup/plugin-commonjs";
import autoExternal from "rollup-plugin-auto-external";
import { uglify } from "rollup-plugin-uglify";
import alias from "@rollup/plugin-alias";
const pkg = require("./package.json");
const banner = `/*!
* ${pkg.name} v${pkg.version}
* (c) 2021-${new Date().getFullYear()} yym
* Released under the MIT License.
*/`;
export default {
input: "src/index.ts",
output: {
banner,
format: "cjs",
sourcemap: true,
file: pkg.main,
name: pkg.name,
},
external: ["miniprogram-ci", "path", "tty", "os"],
plugins: [
resolve(),
common(),
json(),
alias({
core: "./src/core",
command: "./src/core/command",
utils: "./src/utils",
types: "./src/types",
}),
autoExternal(),
typescript({ useTsconfigDeclarationDir: true }),
sourcemap(),
uglify(),
],
};