1
0
mirror of https://github.com/alexandrev/xslt-lab.git synced 2026-09-20 04:23:16 +00:00

Perf: load Monaco from CDN, preload logo, suppress ResizeObserver noise

This commit is contained in:
alexandrev-tibco
2026-04-16 11:04:33 +02:00
parent 56cac47eea
commit 02dc29db82
3 changed files with 27 additions and 1 deletions
+11 -1
View File
@@ -3,6 +3,16 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preload" href="/logo.svg" as="image" type="image/svg+xml" />
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<script>
window.addEventListener("error", function (e) {
if (e.message && e.message.includes("ResizeObserver loop")) {
e.stopImmediatePropagation();
}
}, true);
</script>
<title>XSLT Playground — Online XSLT Editor, Tester &amp; Validator</title>
<meta
name="description"
@@ -146,7 +156,7 @@
<div id="root">
<div class="app-shell" role="status" aria-live="polite">
<div class="shell-top">
<img src="/logo.svg" alt="XSLT Playground logo" class="shell-logo" />
<img src="/logo.svg" alt="XSLT Playground logo" class="shell-logo" fetchpriority="high" />
<div>
<h1 class="shell-title">XSLT Playground</h1>
<div class="shell-subtitle">Loading the editor...</div>
+5
View File
@@ -14,6 +14,11 @@ import {
/* global __APP_VERSION__ */
import { loader } from "@monaco-editor/react";
loader.config({
paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs" },
});
const MonacoEditor = lazy(() => import("@monaco-editor/react"));
const FeedbackWidget = lazy(() => import("./components/FeedbackWidget"));
const BuyMeACoffee = lazy(() => import("./components/BuyMeACoffee"));
+11
View File
@@ -14,6 +14,17 @@ export default defineConfig({
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
build: {
rollupOptions: {
external: ["monaco-editor"],
output: {
manualChunks: {
react: ["react", "react-dom"],
monaco: ["@monaco-editor/react"],
},
},
},
},
test: {
environment: "jsdom",
setupFiles: "./src/setupTests.js",