mirror of
https://github.com/zadam/trilium.git
synced 2026-01-16 03:24:24 +01:00
chore(client): disable preact preset-vite
This commit is contained in:
parent
5dd600a291
commit
e2cf0c6e3e
@ -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',
|
||||
|
||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@ -15949,6 +15949,8 @@ snapshots:
|
||||
'@ckeditor/ckeditor5-utils': 47.3.0
|
||||
ckeditor5: 47.3.0
|
||||
es-toolkit: 1.39.5
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@ckeditor/ckeditor5-merge-fields@47.3.0':
|
||||
dependencies:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user