-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.ts
37 lines (35 loc) · 1020 Bytes
/
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
import babel from "@rollup/plugin-babel";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "rollup-plugin-typescript2";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
const config = [
{
input: "src/index.ts",
output: [
{
sourcemap: true,
dir: "dist/cjs",
format: "cjs",
},
{
sourcemap: true,
dir: "dist/es",
format: "esm",
},
],
plugins: [
peerDepsExternal(),
typescript({
tsconfig: "./tsconfig.build.json",
useTsconfigDeclarationDir: true,
}),
babel({
babelHelpers: "bundled",
presets: ["@babel/preset-react"],
extensions: [".js", ".ts", ".jsx", ".tsx"],
}),
commonjs({ include: "node_modules/**" }),
],
},
];
export default config;