chore(client-standalone): integrate faster preact

This commit is contained in:
Elian Doran 2026-01-11 17:47:11 +02:00
parent a955eb80da
commit 4a4a7d79c2
No known key found for this signature in database

View File

@ -1,6 +1,6 @@
import preact from "@preact/preset-vite";
import { defineConfig } from 'vite';
import prefresh from '@prefresh/vite';
import { join } from 'path';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
const assets = ["assets", "stylesheets", "fonts", "translations"];
@ -40,11 +40,6 @@ const sqliteWasmPlugin = viteStaticCopy({
});
let plugins: any = [
preact({
babel: {
compact: !isDev
}
}),
sqliteWasmPlugin, // Always include SQLite WASM files
viteStaticCopy({
targets: assets.map((asset) => ({
@ -59,7 +54,10 @@ let plugins: any = [
})
}),
// Watch client files for changes in development
...(isDev ? [clientWatchPlugin()] : [])
...(isDev ? [
prefresh(),
clientWatchPlugin()
] : [])
];
if (!isDev) {
@ -82,6 +80,15 @@ export default defineConfig(() => ({
cacheDir: '../../../node_modules/.vite/apps/client-standalone',
base: "",
plugins,
esbuild: {
jsx: 'automatic',
jsxImportSource: 'preact',
jsxDev: isDev
},
css: {
transformer: 'lightningcss',
devSourcemap: isDev
},
publicDir: join(__dirname, 'public'),
resolve: {
alias: [