Skip to content

Commit fa04282

Browse files
committed
fix: load desktop fonts and map icons from the served asset path
1 parent 228f21f commit fa04282

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

next.config.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import type { NextConfig } from "next";
22

33
const nextConfig: NextConfig = {
44
output: "standalone",
5-
experimental: {
6-
inlineCss: true,
7-
},
85
env: {
96
CESIUM_BASE_URL: "/cesium/",
107
NEXT_PUBLIC_BUILD_TARGET: process.env.NEXT_PUBLIC_BUILD_TARGET || "",
@@ -23,6 +20,19 @@ const nextConfig: NextConfig = {
2320
},
2421
];
2522
},
23+
async rewrites() {
24+
return [
25+
// Some bundled CSS (notably Leaflet) emits asset url()s as
26+
// /static/media/* instead of the served /_next/static/media/*. The
27+
// standalone server (and the Electron desktop build that runs it) only
28+
// serves assets under /_next/static, so those requests 404. Map them so
29+
// the assets resolve wherever they are referenced from.
30+
{
31+
source: "/static/media/:path*",
32+
destination: "/_next/static/media/:path*",
33+
},
34+
];
35+
},
2636
async headers() {
2737
const securityHeaders = [
2838
{ key: "X-Content-Type-Options", value: "nosniff" },

0 commit comments

Comments
 (0)