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.whey.party"
14const DEV_URL = "https://local3768forumtest.whey.party"
15
16function shp(url: string): string {
17 return url.replace(/^https?:\/\//, '');
18}
19
20// https://vitejs.dev/config/
21export default defineConfig({
22 plugins: [
23 generateMetadataPlugin({
24 prod: PROD_URL,
25 dev: DEV_URL,
26 }),
27 TanStackRouterVite({ autoCodeSplitting: true }),
28 viteReact({
29 babel: {
30 plugins: ['babel-plugin-react-compiler'],
31 },
32 }),
33 tailwindcss(),
34 AutoImport({
35 include: [
36 /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
37 ],
38 resolvers: [
39 IconsResolver({
40 prefix: 'Icon',
41 extension: 'jsx',
42 }),
43 ],
44 dts: 'src/auto-imports.d.ts',
45 }),
46 Icons({
47 autoInstall: true,
48 compiler: 'jsx',
49 jsx: 'react'
50 }),
51 ],
52 // test: {
53 // globals: true,
54 // environment: 'jsdom',
55 // },
56 resolve: {
57 alias: {
58 "@": resolve(__dirname, "./src"),
59 "~": resolve(__dirname, "./src"),
60 },
61 },
62 server: {
63 allowedHosts: [shp(PROD_URL),shp(DEV_URL)],
64 },
65 css: {
66 devSourcemap: true,
67 },
68});