Skip to content

Commit

Permalink
Merge pull request #346 from reduxjs/feature/more-webpack4-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Apr 3, 2023
2 parents 0209f09 + c0d0294 commit b6605fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -145,7 +145,7 @@ jobs:
run: yarn test
if: matrix.example != 'are-the-types-wrong'

- name: Run test step
- name: Run test step (attw)
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
# Ignore "FalseCJS" errors in the `attw` job
run: yarn test -n FalseCJS
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -15,7 +15,7 @@
],
"author": "Dan Abramov <dan.abramov@me.com>",
"main": "dist/cjs/redux-thunk.cjs",
"module": "dist/redux-thunk.mjs",
"module": "dist/redux-thunk.legacy-esm.js",
"types": "dist/redux-thunk.d.ts",
"exports": {
"./package.json": "./package.json",
Expand Down
10 changes: 9 additions & 1 deletion tsup.config.ts
@@ -1,4 +1,5 @@
import { defineConfig, Options } from 'tsup'
import fs from 'fs'

export default defineConfig(options => {
const commonOptions: Partial<Options> = {
Expand All @@ -14,7 +15,14 @@ export default defineConfig(options => {
format: ['esm'],
outExtension: () => ({ js: '.mjs' }),
dts: true,
clean: 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'
)
}
},
{
...commonOptions,
Expand Down

0 comments on commit b6605fb

Please sign in to comment.