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 +// } +// });