Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/reduxjs/redux-thunk into …
Browse files Browse the repository at this point in the history
…format-all-files
  • Loading branch information
aryaemami59 committed Mar 22, 2024
2 parents 826e453 + c403cf7 commit ca866dc
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tsup.config.ts
@@ -1,5 +1,5 @@
import { defineConfig, Options } from 'tsup'
import fs from 'fs'
import type { Options } from 'tsup'
import { defineConfig } from 'tsup'

export default defineConfig(options => {
const commonOptions: Partial<Options> = {
Expand All @@ -16,13 +16,15 @@ export default defineConfig(options => {
outExtension: () => ({ js: '.mjs' }),
dts: true,
clean: true,
onSuccess() {
// Support Webpack 4 by pointing `"module"` to a file with a `.js` extension
fs.copyFileSync(
'dist/redux-thunk.mjs',
'dist/redux-thunk.legacy-esm.js',
)
},
},
// 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,
Expand Down

0 comments on commit ca866dc

Please sign in to comment.