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)) }] } }; });