From ab0d3a285760fcf62b51ab114f6a5427cedddae6 Mon Sep 17 00:00:00 2001 From: arobsn <87387688+arobsn@users.noreply.github.com> Date: Sun, 28 Jan 2024 22:22:00 -0300 Subject: [PATCH] set base dir --- packages/ui/vite.config.ts | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/packages/ui/vite.config.ts b/packages/ui/vite.config.ts index 0ffd640..b9b6fae 100644 --- a/packages/ui/vite.config.ts +++ b/packages/ui/vite.config.ts @@ -4,15 +4,31 @@ import { defineConfig } from "vite"; import svgLoader from "vite-svg-loader"; // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [vue(), svgLoader()], - base: "./", - resolve: { - alias: { - "@": path.resolve(__dirname, "./src") + +export default defineConfig(({ mode }) => { + return { + plugins: [vue(), svgLoader()], + base: mode === "production" ? "ergsnap/" : "./", + resolve: { + alias: { + "@": path.resolve(__dirname, "./src") + } + }, + server: { + port: 8000 } - }, - server: { - port: 8000 - } + }; }); + +// export default defineConfig({ +// plugins: [vue(), svgLoader()], +// base: import.meta.env.PROD ? "./" : "", +// resolve: { +// alias: { +// "@": path.resolve(__dirname, "./src") +// } +// }, +// server: { +// port: 8000 +// } +// });