25 lines
644 B
TypeScript
25 lines
644 B
TypeScript
import { fileURLToPath, URL } from "node:url";
|
|
import { defineConfig, loadEnv } from "vite";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
import vueDevTools from "vite-plugin-vue-devtools";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "VITE");
|
|
const baseURL = fileURLToPath(new URL("./src", import.meta.url));
|
|
|
|
return {
|
|
define: {
|
|
API_URL: JSON.stringify(env.VITE_API_URL),
|
|
API_KEY: JSON.stringify(env.VITE_API_KEY),
|
|
},
|
|
plugins: [vue(), vueDevTools()],
|
|
resolve: {
|
|
alias: {
|
|
"@": baseURL,
|
|
"~": baseURL,
|
|
},
|
|
},
|
|
};
|
|
});
|