Skip to content

Commit ca866dc

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/redux-thunk into format-all-files
2 parents 826e453 + c403cf7 commit ca866dc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

tsup.config.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineConfig, Options } from 'tsup'
2-
import fs from 'fs'
1+
import type { Options } from 'tsup'
2+
import { defineConfig } from 'tsup'
33

44
export default defineConfig(options => {
55
const commonOptions: Partial<Options> = {
@@ -16,13 +16,15 @@ export default defineConfig(options => {
1616
outExtension: () => ({ js: '.mjs' }),
1717
dts: true,
1818
clean: true,
19-
onSuccess() {
20-
// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
21-
fs.copyFileSync(
22-
'dist/redux-thunk.mjs',
23-
'dist/redux-thunk.legacy-esm.js',
24-
)
25-
},
19+
},
20+
// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
21+
{
22+
...commonOptions,
23+
format: ['esm'],
24+
target: 'es2017',
25+
dts: false,
26+
outExtension: () => ({ js: '.js' }),
27+
entry: { 'redux-thunk.legacy-esm': 'src/index.ts' },
2628
},
2729
{
2830
...commonOptions,

0 commit comments

Comments
 (0)