From 213a1a6887a0b6ee9285fa3d84fee55c2465885a Mon Sep 17 00:00:00 2001 From: Otavio Vasques Date: Sat, 7 Dec 2024 09:06:56 -0300 Subject: [PATCH] Works in dev, works in prod? --- vite.config.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/vite.config.js b/vite.config.js index 27c6e3b..03006ee 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,15 +2,19 @@ import { resolve } from 'path'; import { defineConfig } from 'vitest/config'; import { sveltekit } from '@sveltejs/kit/vite'; -export default defineConfig({ - plugins: [sveltekit()], - resolve: { - alias: { - $fonts: resolve('./static/fonts') - } - }, +export default defineConfig(({mode}) => { + return { + plugins: [sveltekit()], - test: { - include: ['src/**/*.{test,spec}.{js,ts}'] - } + resolve: { + alias: { + $fonts: (mode == "production") ? resolve('./static/fonts') : "/fonts" + } + }, + + test: { + include: ['src/**/*.{test,spec}.{js,ts}'] + } + + }; });