From 963492266dc95cc8aae9f3c9b27b72ae1f8d1fbc Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 2 Jul 2024 14:16:54 +0000 Subject: [PATCH 1/2] Move monaco's JS to its own rollup chunk --- gui/vite.config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gui/vite.config.ts b/gui/vite.config.ts index 6f20a22e..cba0ec63 100644 --- a/gui/vite.config.ts +++ b/gui/vite.config.ts @@ -4,6 +4,15 @@ import { configDefaults, coverageConfigDefaults } from "vitest/config"; // https://vitejs.dev/config/ export default defineConfig({ + build: { + rollupOptions: { + output: { + manualChunks: { + monaco: ["monaco-editor", "@monaco-editor/react"], + }, + }, + }, + }, test: { // note for testing: mockReset clears all spies/mocks and resets to empty function, // while restoreMocks: true calls .mockRestore() thereby clearing spies & mock From eeac55c18ab67f8eecf00c6e838ba154f4cb27b6 Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Tue, 2 Jul 2024 14:32:10 +0000 Subject: [PATCH 2/2] Also chunk loader utilities --- gui/vite.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/vite.config.ts b/gui/vite.config.ts index cba0ec63..63ae5a6b 100644 --- a/gui/vite.config.ts +++ b/gui/vite.config.ts @@ -9,6 +9,7 @@ export default defineConfig({ output: { manualChunks: { monaco: ["monaco-editor", "@monaco-editor/react"], + utilities: ["jszip", "@octokit/rest"], }, }, },