diff --git a/vite.config.js b/vite.config.js index 55606e6..fea6654 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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}`,