mirror of
https://github.com/zadam/trilium.git
synced 2025-10-05 21:15:01 +08:00
feat(react): set up client to support Preact with JSX
This commit is contained in:
parent
425ade5212
commit
3361a2e4ab
3 changed files with 8 additions and 1 deletions
|
@ -59,6 +59,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@ckeditor/ckeditor5-inspector": "5.0.0",
|
||||
"@preact/preset-vite": "2.10.2",
|
||||
"@types/bootstrap": "5.2.10",
|
||||
"@types/jquery": "3.5.32",
|
||||
"@types/leaflet": "1.9.20",
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
"lib": [ "ESNext" ],
|
||||
"outDir": "dist",
|
||||
"types": [
|
||||
"node"
|
||||
"node",
|
||||
"preact"
|
||||
],
|
||||
"rootDir": "src",
|
||||
"jsx": "preserve",
|
||||
"jsxFactory": "h",
|
||||
"jsxImportSource": "preact",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
|
||||
|
|
|
@ -4,6 +4,7 @@ import { defineConfig, type Plugin } from 'vite';
|
|||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||
import asset_path from './src/asset_path';
|
||||
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
|
||||
import preact from "@preact/preset-vite";
|
||||
|
||||
const assets = [ "assets", "stylesheets", "fonts", "translations" ];
|
||||
|
||||
|
@ -20,6 +21,7 @@ export default defineConfig(() => ({
|
|||
host: 'localhost',
|
||||
},
|
||||
plugins: [
|
||||
preact(),
|
||||
viteStaticCopy({
|
||||
targets: assets.map((asset) => ({
|
||||
src: `src/${asset}/*`,
|
||||
|
|
Loading…
Add table
Reference in a new issue