Skip to content

Build your personal knowledge base with Trilium Notes

chore(client): disable preact preset-vite

Elian Dorane2cf0c6e3e7f
diff --git a/apps/client/vite.config.mts b/apps/client/vite.config.mts
index 4fe9646e45..1deb7469cb 100644
--- a/apps/client/vite.config.mts
+++ b/apps/client/vite.config.mts
@@ -1,5 +1,4 @@
/// <reference types='vitest' />
-import preact from "@preact/preset-vite";
import { join, resolve } from 'path';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
import { defineConfig, type Plugin } from 'vite';
@@ -8,15 +7,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'
const assets = [ "assets", "stylesheets", "fonts", "translations" ];
const isDev = process.env.NODE_ENV === "development";
-let plugins: any = [
- preact({
- // Disable Babel in dev for faster transforms (use esbuild instead)
- // Babel takes ~2.5s per TSX file, esbuild takes ~100ms
- babel: isDev ? undefined : {
- compact: true
- }
- })
-];
+let plugins: any = [];
if (!isDev) {
plugins = [
@@ -45,6 +36,12 @@ export default defineConfig(() => ({
cacheDir: '../../.cache/vite',
base: "",
plugins,
+ // Use esbuild for JSX transformation (much faster than Babel)
+ esbuild: {
+ jsx: 'automatic',
+ jsxImportSource: 'preact',
+ jsxDev: isDev
+ },
css: {
// Use Lightning CSS (Rust-based) for much faster CSS transforms
transformer: 'lightningcss',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 84ec2fe15b..83189eb865 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -15949,6 +15949,8 @@ snapshots:
'@ckeditor/ckeditor5-utils': 47.3.0
ckeditor5: 47.3.0
es-toolkit: 1.39.5
+ transitivePeerDependencies:
+ - supports-color
'@ckeditor/[email protected]':
dependencies: