From ec05b7607806d748614e8c07e987f97ab6ece467 Mon Sep 17 00:00:00 2001 From: Chad Freeman Date: Sun, 12 Jan 2025 14:53:13 -0500 Subject: [PATCH] Chaning to a provider system for desktop and web variants --- bun.lockb | Bin 56090 -> 56532 bytes package.json | 4 +++- src/lib/CodeEditor.svelte | 2 +- src/lib/build/{index.ts => esbuild.ts} | 6 ++--- src/lib/provider/Provider.ts | 30 +++++++++++++++++++++++++ src/routes/+layout.ts | 3 ++- vite.config.ts | 5 ++++- 7 files changed, 43 insertions(+), 7 deletions(-) rename src/lib/build/{index.ts => esbuild.ts} (83%) create mode 100644 src/lib/provider/Provider.ts diff --git a/bun.lockb b/bun.lockb index 97762e5b95b3e1a3e0dbf4099a5e1debbacd98ea..a89b87f8939176a5390c82fbb0c3f77d801607c0 100755 GIT binary patch delta 8726 zcmeHNd014(mcMoFRvK*uBhXDFiyJgbv(q5h?Sd>e?wTtqC@4!Kh-_|A!K{!c3Z54b z6(iz?FPaz=6OEIJS;m-&^EAdJK9|IqBnpn^nY_Gce8KtE?Y?xrmzjL?CG$=Gd6(~; z-&v~a)~Tvnw{9P{9_{tvv0e=(W69(QE#v!AA%5BX~9yf|$<)eEYAeGzCHN?^?jv`jyWc52+%O6t&9*=N+L zv5Gp8LftK5zDPyx7Pg-{+^y_u>U6h?k-aFiuSFe&2XhLQ^iNVj$e^&kiR$+qk~T@z zTQM!}kzRl_NiOz1q%>I?-$#+2?vXy|k$l}0Z*Grtz#;WZQuUZdVrP<$iMVR z{V-f9^1Wt2N|vRj9_dd#l0PQL;muVf_A(hgt!gut|2zuwOjK`%lqpL$A%zE zHb^sN+igf$vSh=fVwa_tAmzxC7beDGTL;Ne?h>Q|x-~FKg{L4-F18QS0$J*fUCANk zL2^`h6OyAV20T9w?`lX6+j&S5uPcUnQK+{?Ec2owZwos}9o|+^^rkK-ZSRA&)0bX26Xunp9qv$EHzQ)kuu1VZUD)#lGE`vprfM<)}r#BtenKk9m;-RUi4BCMn4Smr3JG3bH7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vTGoV86+%rIY&ot5@7jzR;%r zXj0b9UhL>KRB zC{g~#Ob;9^n{pcqFB)r4ONIrG{Ino?YhDlTON+C_p>tYVEb?4OQIvVPPW2?F#95?J z`skp^oEPrOT7@KyNRR9rcL4qrY((f$G5H@#np6e9Kb}w_)h`D_YC`2cz*p| zxU}?Ro8N<`p1fNlJf3so>E-qugEm}cbgw1?OY^P?Z3jixpk|t2$VUt-) z0ygR9js3QDD|Q6DHY~giEu_tdO*mrjJ8TNkQi#2SVz>A@-^G@s)jA$ceTR)HTF%il z>32oPy7zT^Dri~BNz0=2B`x|tcszO!|OP-24FReqq8VWpva?Y z< { + throw new TypeError("BuildToVite capability is not available") + } + + /** + * Build JS + */ + async buildJS(input: string): Promise { + return (await buildProject(input, true)).code + } +} \ No newline at end of file diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 2223a9d..0a06f03 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -1 +1,2 @@ -export const csr = true; \ No newline at end of file +export const csr = true; +export const prerender = true; \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index bbf8c7d..8a4c5fd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,5 +2,8 @@ import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; export default defineConfig({ - plugins: [sveltekit()] + plugins: [sveltekit()], + build: { + target: ['es2022'] + } });