-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.mjs
49 lines (48 loc) · 1.13 KB
/
rollup.config.mjs
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
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import terser from "@rollup/plugin-terser";
import postcss from "rollup-plugin-postcss";
export default [
{
input: "./index.ts",
external: ["test/**"],
output: [
{
dir: "lib",
format: "cjs",
entryFileNames: "[name].cjs.js",
sourcemap: false,
},
{
dir: "lib",
format: "esm",
entryFileNames: "[name].esm.js",
sourcemap: false,
},
{
dir: "lib",
format: "umd",
entryFileNames: "[name].umd.js",
name: "$AgentFlow", // umd 模块名称,相当于一个命名空间,会自动挂载到window下面
sourcemap: false,
plugins: [terser()],
},
],
plugins: [
postcss({
minimize: true,
extensions: [".css"],
extract: true,
}),
resolve(),
commonjs(),
typescript({
tsconfig: "./tsconfig.json",
compilerOptions: {
incremental: false,
},
}),
],
},
];