chadtmiller.com/knotless

Git hosted in your atproto account, on any stock PDS, fast enough for agents.

git clone knotless://chadtmiller.com/knotless

needs the knotless git helper. set it up

main
34 lines · 949 B Raw History
import adapter from '@sveltejs/adapter-node';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';

/** knotless-serve, which `vite dev` hands what it answers itself. */
const serve = process.env.KNOTLESS_SERVE ?? 'http://127.0.0.1:2590';

export default defineConfig({
	server: {
		proxy: { '^/(_data|xrpc)/': serve, '^/[^/]+/[^/]+/raw/': serve }
	},
	plugins: [
		sveltekit({
			compilerOptions: { runes: true },
			adapter: adapter(),
			// One stylesheet, small enough to come with each page.
			inlineStyleThreshold: Infinity,
			csp: {
				mode: 'hash',
				directives: {
					'default-src': ['none'],
					'img-src': ['self', 'https:', 'data:'],
					// Avatars take their hue from a style attribute.
					'style-src': ['unsafe-inline'],
					'script-src': ['self'],
					'connect-src': ['self'],
					'base-uri': ['none'],
					'form-action': ['self'],
					'frame-ancestors': ['none']
				}
			}
		})
	]
});