an appview-less Bluesky client using Constellation and PDS Queries
reddwarf.app
frontend
spa
bluesky
reddwarf
microcosm
1import { resolve } from "node:path";
2
3import tailwindcss from "@tailwindcss/vite";
4import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
5import viteReact from "@vitejs/plugin-react";
6import AutoImport from 'unplugin-auto-import/vite'
7import IconsResolver from 'unplugin-icons/resolver'
8import Icons from 'unplugin-icons/vite'
9import { defineConfig } from "vite";
10
11import { generateMetadataPlugin } from "./oauthdev.mts";
12
13const PROD_URL = "https://reddwarf.app"
14const DEV_URL = "https://local3768forumtest.whey.party"
15
16const PROD_HANDLE_RESOLVER_PDS = "https://pds-nd.whey.party"
17const DEV_HANDLE_RESOLVER_PDS = "https://bsky.social"
18
19function shp(url: string): string {
20 return url.replace(/^https?:\/\//, '');
21}
22
23// https://vitejs.dev/config/
24export default defineConfig({
25 plugins: [
26 generateMetadataPlugin({
27 prod: PROD_URL,
28 dev: DEV_URL,
29 prodResolver: PROD_HANDLE_RESOLVER_PDS,
30 devResolver: DEV_HANDLE_RESOLVER_PDS,
31 }),
32 TanStackRouterVite({ autoCodeSplitting: true }),
33 viteReact({
34 babel: {
35 plugins: ['babel-plugin-react-compiler'],
36 },
37 }),
38 tailwindcss(),
39 AutoImport({
40 include: [
41 /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
42 ],
43 resolvers: [
44 IconsResolver({
45 prefix: 'Icon',
46 extension: 'jsx',
47 enabledCollections: ['mdi','material-symbols'],
48 }),
49 ],
50 dts: 'src/auto-imports.d.ts',
51 }),
52 Icons({
53 //autoInstall: true,
54 compiler: 'jsx',
55 jsx: 'react'
56 }),
57 ],
58 // test: {
59 // globals: true,
60 // environment: 'jsdom',
61 // },
62 resolve: {
63 alias: {
64 "@": resolve(__dirname, "./src"),
65 "~": resolve(__dirname, "./src"),
66 },
67 },
68 server: {
69 allowedHosts: [shp(PROD_URL),shp(DEV_URL)],
70 },
71 css: {
72 devSourcemap: true,
73 },
74});