Update vite config

This commit is contained in:
bytedream 2025-04-04 00:44:51 +02:00
parent 6aaf960c28
commit 3ac73ac3b4

View File

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