diff --git a/bun.lockb b/bun.lockb index 24fcaea..3859846 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/esbuild.config.js b/esbuild.config.js index dea8ba9..c26b1ce 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -1,8 +1,23 @@ import { execSync } from "child_process"; import { build } from "esbuild"; +import { readFile } from "fs/promises"; execSync("rm -rf ./dist && mkdir dist"); +const cleaner = { + name: "cleaner", + setup(build) { + build.onLoad({ filter: /store\/index.ts*/ }, async (args) => { + const source = await readFile(args.path, "utf8"); + console.log(args.path); + return { + contents: source.replaceAll(`(await import("@dreamworld/addon-redux")).enhancer`, "null"), + loader: "ts" + }; + }); + } +}; + build({ entryPoints: ["./src/index.tsx"], bundle: true, @@ -15,5 +30,6 @@ build({ loader: { ".png": "file" }, + plugins: [cleaner], external: ["react", "react-dom", "@dreamworld/addon-redux"] }); diff --git a/package.json b/package.json index 3a42260..fa63138 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "bun run ./esbuild.config.js && bun build:css", - "build:css": "bunx tailwindcss -o ./dist/index.css --minify", + "build:css": "bunx tailwindcss -i src/styles/index.css -o ./dist/index.css --minify", "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", "format": "bunx prettier --write --cache \"**/*.{js,jsx,ts,tsx,md,css,yml}\"", "lint": "bun run --bun eslint . --ext js,jsx,ts,tsx,mdx --ignore-path .gitignore --fix --cache --report-unused-disable-directives", diff --git a/src/store/index.ts b/src/store/index.ts index c8ea5a2..bfec12d 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,9 +1,10 @@ import { configureStore } from "@reduxjs/toolkit"; +import type { StoreEnhancer } from "redux"; import { default as rootReducer } from "./reducers"; const storybook = process.env.NODE_ENV === "storybook"; -let withReduxEnhancer; +let withReduxEnhancer: StoreEnhancer; if (storybook) { // @ts-expect-error - This is a dynamic import diff --git a/src/styles/index.css b/src/styles/index.css index ff49954..1787fad 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -74,6 +74,7 @@ @layer base { html, body, + #root, #storybook-root { min-height: 100% !important; height: 100% !important;