diff --git a/tsup.config.ts b/tsup.config.ts index ef64188..dbdf49a 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,4 +1,3 @@ -import fs from 'node:fs/promises' import type { Options } from 'tsup' import { defineConfig } from 'tsup' @@ -17,14 +16,16 @@ export default defineConfig(options => { format: ['esm'], outExtension: () => ({ js: '.mjs' }), dts: true, - clean: true, - async onSuccess() { - // Support Webpack 4 by pointing `"module"` to a file with a `.js` extension - await fs.copyFile( - 'dist/redux-thunk.mjs', - 'dist/redux-thunk.legacy-esm.js' - ) - } + clean: true + }, + // Support Webpack 4 by pointing `"module"` to a file with a `.js` extension + { + ...commonOptions, + format: ['esm'], + target: 'es2017', + dts: false, + outExtension: () => ({ js: '.js' }), + entry: { 'redux-thunk.legacy-esm': 'src/index.ts' } }, { ...commonOptions,