-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
43 lines (41 loc) · 970 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
42
43
const commonjs = require("@rollup/plugin-commonjs");
const resolve = require("@rollup/plugin-node-resolve").default;
const strip = require("@rollup/plugin-strip");
const url = require("@rollup/plugin-url");
const external = require("rollup-plugin-peer-deps-external");
const fs = require("fs");
const typescript = require("rollup-plugin-typescript2");
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"));
export default {
input: "src/index.tsx",
output: [
{
file: pkg.main,
format: "cjs",
plugins: [],
exports: "named",
sourcemap: false
},
{
file: pkg.module,
format: "es",
exports: "named",
sourcemap: false
},
{
file: pkg.module,
format: "esm",
exports: "named",
sourcemap: false
}
],
external: ["react"],
plugins: [
strip(),
external(),
url(),
typescript({ clean: true }),
resolve({ browser: true, preferBuiltins: false }),
commonjs({ sourceMap: false, ignoreGlobal: false })
]
};