Fix: explicitly copy icon_500.png to dist target

This commit is contained in:
2026-03-10 22:49:14 -07:00
parent c4021803da
commit 9e97c6c7ab

View File

@@ -1,4 +1,5 @@
import { defineConfig } from 'vite';
import fs from 'node:fs';
const target = process.env.TARGET || 'firefox';
@@ -52,6 +53,16 @@ export default defineConfig(async () => {
);
}
// Custom plugin to ensure the icon is always copied to the target output directory
plugins.push({
name: 'copy-icon',
writeBundle() {
if (fs.existsSync('icon_500.png')) {
fs.copyFileSync('icon_500.png', `dist/${target}/icon_500.png`);
}
}
});
return {
build: {
outDir: `dist/${target}`,