|
1 | | -import { defineConfig } from "vite"; |
| 1 | +import { fileURLToPath, URL } from "node:url"; |
2 | 2 | import react from "@vitejs/plugin-react"; |
| 3 | +import { defineConfig } from "vite"; |
| 4 | + |
| 5 | +const source = (relativePath: string) => |
| 6 | + fileURLToPath(new URL(`../../packages/react/src/${relativePath}`, import.meta.url)); |
3 | 7 |
|
4 | 8 | export default defineConfig({ |
5 | 9 | plugins: [react()], |
| 10 | + resolve: { |
| 11 | + alias: [ |
| 12 | + { find: /^@baseui\.sh\/react\/styles\.css$/, replacement: source("styles.css") }, |
| 13 | + { find: /^@baseui\.sh\/react\/tokens\.css$/, replacement: source("tokens.css") }, |
| 14 | + { find: /^@baseui\.sh\/react\/phosphor\/ssr$/, replacement: source("phosphor-ssr.ts") }, |
| 15 | + { find: /^@baseui\.sh\/react\/phosphor$/, replacement: source("phosphor.ts") }, |
| 16 | + { find: /^@baseui\.sh\/react\/tokens$/, replacement: source("tokens.ts") }, |
| 17 | + { find: /^@baseui\.sh\/react\/icons$/, replacement: source("icons.tsx") }, |
| 18 | + { find: /^@baseui\.sh\/react\/foundations$/, replacement: source("foundations/index.ts") }, |
| 19 | + { find: /^@baseui\.sh\/react\/actions$/, replacement: source("actions/index.ts") }, |
| 20 | + { find: /^@baseui\.sh\/react\/forms$/, replacement: source("forms/index.ts") }, |
| 21 | + { find: /^@baseui\.sh\/react\/data-display$/, replacement: source("data-display/index.ts") }, |
| 22 | + { find: /^@baseui\.sh\/react\/feedback$/, replacement: source("feedback/index.ts") }, |
| 23 | + { find: /^@baseui\.sh\/react\/navigation$/, replacement: source("navigation/index.ts") }, |
| 24 | + { find: /^@baseui\.sh\/react\/disclosure$/, replacement: source("disclosure/index.ts") }, |
| 25 | + { find: /^@baseui\.sh\/react\/overlays$/, replacement: source("overlays/index.ts") }, |
| 26 | + { find: /^@baseui\.sh\/react\/patterns$/, replacement: source("patterns/index.ts") }, |
| 27 | + { find: /^@baseui\.sh\/react\/hooks$/, replacement: source("hooks/index.ts") }, |
| 28 | + { find: /^@baseui\.sh\/react$/, replacement: source("index.ts") }, |
| 29 | + ], |
| 30 | + }, |
6 | 31 | }); |
0 commit comments