Use vite --mode for target selection

This commit is contained in:
2026-09-12 15:00:07 -07:00
parent f7372635fe
commit 7c024baac0
2 changed files with 6 additions and 7 deletions

View File

@@ -1,9 +1,8 @@
import { defineConfig } from 'vite';
import fs from 'node:fs';
const target = process.env.TARGET || 'firefox';
export default defineConfig(async () => {
export default defineConfig(async ({ mode }) => {
const target = process.env.TARGET || (['chrome', 'firefox', 'web'].includes(mode) ? mode : 'chrome');
const plugins = [];
if (target !== 'web') {