Skip to content

Commit 1ad3326

Browse files
committed
Fix: excluded redux addon from bundle
1 parent d7e3d00 commit 1ad3326

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

esbuild.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ build({
1515
loader: {
1616
".png": "file"
1717
},
18-
external: ["react", "react-dom"]
18+
external: ["react", "react-dom", "@dreamworld/addon-redux"]
1919
});

src/store/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { enhancer as withReduxEnhancer } from "@dreamworld/addon-redux";
21
import { configureStore } from "@reduxjs/toolkit";
32
import { default as rootReducer } from "./reducers";
43

54
const storybook = process.env.NODE_ENV === "storybook";
65

6+
let withReduxEnhancer;
7+
8+
if (storybook) {
9+
// @ts-expect-error - This is a dynamic import
10+
withReduxEnhancer = (await import("@dreamworld/addon-redux")).enhancer;
11+
}
12+
713
export function makeStore() {
814
return configureStore({
915
devTools: storybook,

0 commit comments

Comments
 (0)