Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit b093881

Browse files
committed
Chore: Cleaned up rollup config.
1 parent 814a74f commit b093881

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

rollup.config.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import ts from "@wessberg/rollup-plugin-ts";
22
import path from "path";
3-
import nodeResolve from "rollup-plugin-node-resolve";
43
import { terser } from "rollup-plugin-terser";
5-
const extensions = [".ts", ".tsx"];
64

75
function isBareModuleId(id) {
86
if (id.startsWith(".")) {
@@ -19,25 +17,15 @@ export default function configureRollup() {
1917
// CJS:
2018
{
2119
input: "src/index.ts",
22-
output: { file: `dist/cjs/index.js`, format: "cjs", compact: true },
23-
external: isBareModuleId,
24-
plugins: [
25-
nodeResolve({ extensions }),
26-
ts({
27-
transpiler: "babel",
28-
}),
20+
output: [
21+
{ file: `dist/cjs/index.js`, format: "cjs", compact: true, exports: "auto"},
22+
{ file: `dist/cjs/index.min.js`, format: "cjs", compact: true, exports: "auto", plugins: [terser()],},
2923
],
30-
},
31-
{
32-
input: "src/index.ts",
33-
output: { file: `dist/cjs/index.min.js`, format: "cjs", compact: true },
3424
external: isBareModuleId,
3525
plugins: [
36-
nodeResolve({ extensions }),
3726
ts({
3827
transpiler: "babel",
3928
}),
40-
terser(),
4129
],
4230
},
4331
// ESM:
@@ -46,7 +34,6 @@ export default function configureRollup() {
4634
output: { file: `dist/esm/index.js`, format: "esm" },
4735
external: isBareModuleId,
4836
plugins: [
49-
nodeResolve({ extensions }),
5037
ts({
5138
transpiler: "babel",
5239
}),

0 commit comments

Comments
 (0)