Skip to content

Commit deb1712

Browse files
build: refactor rollup config
1 parent 68e6450 commit deb1712

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

rollup.config.ts

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ const treeshake = {
1515
const classicCJS = {
1616
input: "src/classic.ts",
1717

18-
output: [
19-
{
20-
file: pkg.exports["."].require,
21-
format: "cjs",
22-
sourcemap: false,
23-
},
24-
],
18+
output: {
19+
file: pkg.exports["."].require,
20+
format: "cjs",
21+
sourcemap: false,
22+
},
2523

2624
plugins: [
2725
rollupPluginAutoExternal(),
@@ -51,13 +49,11 @@ const classicCJS = {
5149
const classicESM = {
5250
input: "src/classic.ts",
5351

54-
output: [
55-
{
56-
file: pkg.exports["."].import,
57-
format: "esm",
58-
sourcemap: false,
59-
},
60-
],
52+
output: {
53+
file: pkg.exports["."].import,
54+
format: "esm",
55+
sourcemap: false,
56+
},
6157

6258
plugins: [
6359
rollupPluginAutoExternal(),
@@ -87,13 +83,11 @@ const classicESM = {
8783
const flatCJS = {
8884
input: "src/flat.ts",
8985

90-
output: [
91-
{
92-
file: pkg.exports["./flat"].require,
93-
format: "cjs",
94-
sourcemap: false,
95-
},
96-
],
86+
output: {
87+
file: pkg.exports["./flat"].require,
88+
format: "cjs",
89+
sourcemap: false,
90+
},
9791

9892
plugins: [
9993
rollupPluginAutoExternal(),
@@ -123,13 +117,11 @@ const flatCJS = {
123117
const flatESM = {
124118
input: "src/flat.ts",
125119

126-
output: [
127-
{
128-
file: pkg.exports["./flat"].import,
129-
format: "esm",
130-
sourcemap: false,
131-
},
132-
],
120+
output: {
121+
file: pkg.exports["./flat"].import,
122+
format: "esm",
123+
sourcemap: false,
124+
},
133125

134126
plugins: [
135127
rollupPluginAutoExternal(),

0 commit comments

Comments
 (0)