diff --git a/app/web/.parcelrc b/app/web/.parcelrc index 6690d096..47ce2516 100644 --- a/app/web/.parcelrc +++ b/app/web/.parcelrc @@ -13,6 +13,10 @@ "*.wasm": [ "...", "@parcel/transformer-raw" + ], + "bundle-text:*": [ + "...", + "@parcel/transformer-inline-string" ] } -} \ No newline at end of file +} diff --git a/app/web/package.json b/app/web/package.json index 3a15c05a..322015b0 100644 --- a/app/web/package.json +++ b/app/web/package.json @@ -1,7 +1,7 @@ { "name": "web", "@parcel/bundler-default": { - "minBundles": 1, + "minBundles": 10000000, "minBundleSize": 3000, "maxParallelRequests": 20 }, @@ -16,6 +16,7 @@ "@paralleldrive/cuid2": "2.2.2", "@parcel/packager-wasm": "^2.10.3", "@parcel/service-worker": "^2.10.3", + "@parcel/transformer-inline-string": "^2.12.0", "@qiwi/deep-proxy": "^2.0.3", "@wojtekmaj/react-qr-svg": "^1.0.0", "algoliasearch": "^4.22.0", @@ -106,4 +107,4 @@ "staticFiles": { "staticPath": "public" } -} \ No newline at end of file +} diff --git a/app/web/src/font.ts b/app/web/src/font.ts index d554c5e5..b23ef02a 100644 --- a/app/web/src/font.ts +++ b/app/web/src/font.ts @@ -1,2 +1,8 @@ -import "@fontsource/jetbrains-mono"; -import "@fontsource/source-sans-3"; +//@ts-nocheck +import f1 from "bundle-text:@fontsource/jetbrains-mono/index.css"; +import f2 from "bundle-text:@fontsource/source-sans-3/index.css"; + +let style = document.createElement("style"); +style.textContent = f1.replaceAll(`url("`, `url("/`) + f2.replaceAll(`url("`, `url("/`); +style.id = "font"; +document.head.appendChild(style); diff --git a/bun.lockb b/bun.lockb index 91f332bf..601a10f5 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/pkgs/core/utils/parcel.ts b/pkgs/core/utils/parcel.ts index f46d55d6..02cfdf40 100644 --- a/pkgs/core/utils/parcel.ts +++ b/pkgs/core/utils/parcel.ts @@ -18,6 +18,7 @@ export const parcelBuild = async () => { g.mode === "dev" ? "watch" : "build", "./src/index.html", g.mode === "dev" ? "--no-hmr" : "--no-optimize", + "--no-content-hash", "--dist-dir", dir.path(`app/static`), ];