From c68add145e564b5aee95a648657f3c2318d95430 Mon Sep 17 00:00:00 2001 From: Charles Kornoelje <33156025+charkour@users.noreply.github.com> Date: Sat, 9 Dec 2023 18:30:17 -0500 Subject: [PATCH] fix: remove `addModuleExport` option for cjs. --- rollup.config.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 604cf19d52..a0c6e3ca29 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -78,20 +78,13 @@ function createESMConfig(input, output) { } } -function createCommonJSConfig(input, output, options) { +function createCommonJSConfig(input, output) { return { input, output: { file: `${output}.js`, format: 'cjs', esModule: false, - outro: options.addModuleExport - ? [ - ...Object.entries(options.addModuleExport).map( - ([key, value]) => `module.exports.${key} = ${value};`, - ), - ].join('\n') - : '', }, external, plugins: [ @@ -174,17 +167,7 @@ module.exports = function (args) { } return [ ...(c === 'index' ? [createDeclarationConfig(`src/${c}.ts`, 'dist')] : []), - createCommonJSConfig(`src/${c}.ts`, `dist/${c}`, { - addModuleExport: { - index: { - create: 'create', - useStore: 'useStore', - createStore: 'vanilla.createStore', - }, - vanilla: { createStore: 'createStore' }, - shallow: { shallow: 'shallow$1' }, - }[c], - }), + createCommonJSConfig(`src/${c}.ts`, `dist/${c}`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.js`), createESMConfig(`src/${c}.ts`, `dist/esm/${c}.mjs`), createUMDConfig(`src/${c}.ts`, `dist/umd/${c}`, 'development'),