Skip to content

Commit ac01c0b

Browse files
committed
Fix: bundle errors
1 parent e3d4754 commit ac01c0b

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

bun.lockb

728 Bytes
Binary file not shown.

esbuild.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
import { execSync } from "child_process";
22
import { build } from "esbuild";
3+
import { readFile } from "fs/promises";
34

45
execSync("rm -rf ./dist && mkdir dist");
56

7+
const cleaner = {
8+
name: "cleaner",
9+
setup(build) {
10+
build.onLoad({ filter: /store\/index.ts*/ }, async (args) => {
11+
const source = await readFile(args.path, "utf8");
12+
console.log(args.path);
13+
return {
14+
contents: source.replaceAll(`(await import("@dreamworld/addon-redux")).enhancer`, "null"),
15+
loader: "ts"
16+
};
17+
});
18+
}
19+
};
20+
621
build({
722
entryPoints: ["./src/index.tsx"],
823
bundle: true,
@@ -15,5 +30,6 @@ build({
1530
loader: {
1631
".png": "file"
1732
},
33+
plugins: [cleaner],
1834
external: ["react", "react-dom", "@dreamworld/addon-redux"]
1935
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"scripts": {
1313
"build": "bun run ./esbuild.config.js && bun build:css",
14-
"build:css": "bunx tailwindcss -o ./dist/index.css --minify",
14+
"build:css": "bunx tailwindcss -i src/styles/index.css -o ./dist/index.css --minify",
1515
"bump-version": "bunx --bun automatic-versioning --disable-auto-sync --recursive $(if [ \"$TAG\" != \"latest\" ]; then echo --prerelease; fi) --prerelease-branch=development --prerelease-tag=$TAG --name=@mezh-hq/react-seat-toolkit --ignore-prefixes=ci",
1616
"format": "bunx prettier --write --cache \"**/*.{js,jsx,ts,tsx,md,css,yml}\"",
1717
"lint": "bun run --bun eslint . --ext js,jsx,ts,tsx,mdx --ignore-path .gitignore --fix --cache --report-unused-disable-directives",

src/store/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { configureStore } from "@reduxjs/toolkit";
2+
import type { StoreEnhancer } from "redux";
23
import { default as rootReducer } from "./reducers";
34

45
const storybook = process.env.NODE_ENV === "storybook";
56

6-
let withReduxEnhancer;
7+
let withReduxEnhancer: StoreEnhancer<any>;
78

89
if (storybook) {
910
// @ts-expect-error - This is a dynamic import

src/styles/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
@layer base {
7575
html,
7676
body,
77+
#root,
7778
#storybook-root {
7879
min-height: 100% !important;
7980
height: 100% !important;

0 commit comments

Comments
 (0)