forked from alexreardon/raf-schd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
41 lines (39 loc) · 1004 Bytes
/
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
import babel from "rollup-plugin-babel";
import replace from "rollup-plugin-replace";
import { terser } from "rollup-plugin-terser";
import pkg from "./package.json";
const input = "src/index.js";
const name = "cumulativeRafSchd";
export default [
// Universal module definition (UMD) build
{
input,
output: { format: "umd", file: "dist/cumulative-raf-schd.js", name },
plugins: [
babel(),
replace({ "process.env.NODE_ENV": JSON.stringify("development") }),
],
},
// Universal module definition (UMD) build (production)
{
input,
output: { format: "umd", file: "dist/cumulative-raf-schd.min.js", name },
plugins: [
babel(),
replace({ "process.env.NODE_ENV": JSON.stringify("production") }),
terser(),
],
},
// ESM build
{
input,
output: { format: "esm", file: pkg.module },
plugins: [babel()],
},
// CommonJS build
{
input,
output: { format: "cjs", file: pkg.main },
plugins: [babel()],
},
];