From 3ac73ac3b47d7af7961462f4aeeebb85f2fa9202 Mon Sep 17 00:00:00 2001
From: bytedream <bytedream@protonmail.com>
Date: Fri, 4 Apr 2025 00:44:51 +0200
Subject: [PATCH] Update vite config

---
 vite.config.ts | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index 08fe4fc..ed9544a 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,9 +1,9 @@
-import { defineConfig, loadEnv } from 'vite';
+import { defineConfig, loadEnv, type PluginOption } from 'vite';
 import { svelte } from '@sveltejs/vite-plugin-svelte';
 import webExtension from '@samrum/vite-plugin-web-extension';
-import path from 'path';
 import { getManifest } from './src/manifest';
 import { matches } from './src/lib/match';
+import { fileURLToPath } from 'url';
 
 // https://vitejs.dev/config/
 export default defineConfig(({ mode }) => {
@@ -11,7 +11,7 @@ export default defineConfig(({ mode }) => {
 
 	return {
 		plugins: [
-			svelte(),
+			svelte() as PluginOption,
 			webExtension({
 				manifest: getManifest(Number(env.MANIFEST_VERSION)),
 				additionalInputs: {
@@ -27,12 +27,10 @@ export default defineConfig(({ mode }) => {
 						}
 					]
 				}
-			})
+			}) as unknown as PluginOption
 		],
 		resolve: {
-			alias: {
-				'~': path.resolve(__dirname, './src')
-			}
+			alias: [{ find: '~', replacement: fileURLToPath(new URL('./src', import.meta.url)) }]
 		}
 	};
 });