import { defineConfig } from "vite"; import solidPlugin from "vite-plugin-solid"; export default defineConfig({ plugins: [ solidPlugin(), { name: "mobile-body-class", transformIndexHtml(html) { return html.replace("", ''); }, }, ], build: { outDir: "dist-mobile", emptyOutDir: false, target: "esnext", rollupOptions: { input: "src/popup/index.html", plugins: [ { // Mobile has no extension background, but shared background modules // still use chrome.storage/tabs/alarms. Import the Capacitor-backed // shim before the popup app graph can load those modules. apply: "build", enforce: "pre", transform(code, id) { if (id.includes("src/popup/index")) { return { code: `import "../shared/chrome-shim";\n${code}`, map: null, }; } return null; }, }, ], }, }, define: { "import.meta.env.PEACH_PLATFORM": JSON.stringify("android"), }, });