Skip to content

Commit 70435a0

Browse files
authored
Copy logo as file instead of data url (#695)
fix: remove 300kb object
1 parent 56962ff commit 70435a0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

scripts/build.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ const contexts = await Promise.all([
7373
target: `chrome${CHROME_VERSION}`,
7474
outfile: `${distDir}/renderer.js`,
7575
format: "esm",
76+
assetNames: "assets/[hash]",
77+
publicPath: "replugged://",
7678
loader: {
77-
".png": "dataurl",
79+
".png": "file",
7880
},
7981
}),
8082
]);

src/main/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ electron.app.once("ready", () => {
176176
case "renderer.css":
177177
filePath = join(__dirname, "./renderer.css");
178178
break;
179+
case "assets":
180+
filePath = join(__dirname, reqUrl.hostname, reqUrl.pathname);
181+
break;
179182
case "quickcss":
180183
filePath = join(CONFIG_PATHS.quickcss, reqUrl.pathname);
181184
break;

0 commit comments

Comments
 (0)