Files
js/packages/thirdweb/vite.config.ts
T
MananTank 55bf1ad5a3 Add Storybook for SDK (#4230)
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to add Storybook configuration, update dependencies, and improve story components.

### Detailed summary
- Added Storybook configuration for `storybook` and `build-storybook`
- Updated dependencies for Storybook addons and Vite
- Improved story components for `ConnectButton` and `PayEmbed`
- Defined absolute paths in Storybook config for addons
- Added global CSS styling for Storybook preview
- Created utility functions for story client and wallet adapter

> The following files were skipped due to too many changes: `pnpm-lock.yaml`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
2024-08-22 16:36:54 +00:00

24 lines
559 B
TypeScript

import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
// This config is required for storybook HMR
const quotesIfString = (value: string | undefined) => {
if (value === undefined) {
return undefined;
}
return `"${value}"`;
};
export default defineConfig({
plugins: [react()],
define: {
"process.env.STORYBOOK_CLIENT_ID": quotesIfString(
process.env.STORYBOOK_CLIENT_ID,
),
"process.env.STORYBOOK_ACCOUNT_PRIVATE_KEY": quotesIfString(
process.env.STORYBOOK_ACCOUNT_PRIVATE_KEY,
),
},
});