From deb171237a9750960e27ef974bf42c409753643c Mon Sep 17 00:00:00 2001 From: Rebecca Stevens Date: Mon, 1 Apr 2024 14:34:50 +1300 Subject: [PATCH] build: refactor rollup config --- rollup.config.ts | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/rollup.config.ts b/rollup.config.ts index bee372da1..a720ffdf4 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -15,13 +15,11 @@ const treeshake = { const classicCJS = { input: "src/classic.ts", - output: [ - { - file: pkg.exports["."].require, - format: "cjs", - sourcemap: false, - }, - ], + output: { + file: pkg.exports["."].require, + format: "cjs", + sourcemap: false, + }, plugins: [ rollupPluginAutoExternal(), @@ -51,13 +49,11 @@ const classicCJS = { const classicESM = { input: "src/classic.ts", - output: [ - { - file: pkg.exports["."].import, - format: "esm", - sourcemap: false, - }, - ], + output: { + file: pkg.exports["."].import, + format: "esm", + sourcemap: false, + }, plugins: [ rollupPluginAutoExternal(), @@ -87,13 +83,11 @@ const classicESM = { const flatCJS = { input: "src/flat.ts", - output: [ - { - file: pkg.exports["./flat"].require, - format: "cjs", - sourcemap: false, - }, - ], + output: { + file: pkg.exports["./flat"].require, + format: "cjs", + sourcemap: false, + }, plugins: [ rollupPluginAutoExternal(), @@ -123,13 +117,11 @@ const flatCJS = { const flatESM = { input: "src/flat.ts", - output: [ - { - file: pkg.exports["./flat"].import, - format: "esm", - sourcemap: false, - }, - ], + output: { + file: pkg.exports["./flat"].import, + format: "esm", + sourcemap: false, + }, plugins: [ rollupPluginAutoExternal(),