Ctrl K
ComunidadGuías…

client/vite.config.js

Rama master · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
import { defineConfig, loadEnv } from "vite"
import react from "@vitejs/plugin-react-swc"
import tailwindcss from "@tailwindcss/vite"
import kpiFont from "../shared/visualization/kpiFont.json" with { type: "json" };

export default ({ mode }) => {
  // Load app-level env vars to node-level env vars.
  process.env = { ...process.env, ...loadEnv(mode, `${process.cwd()}/..`) };

  const port = process.env.VITE_APP_CLIENT_PORT || 4018;

  process.env.VITE_APP_VERSION = process.env.npm_package_version;

  return defineConfig({
    plugins: [
      react(),
      tailwindcss(),
      {
        name: "kpi-font",
        transformIndexHtml() {
          return [
            { tag: "link", attrs: { rel: "stylesheet", href: kpiFont.stylesheet }, injectTo: "head" },
            { tag: "style", children: `:root { --kpi-font-family: "${kpiFont.family}", sans-serif; }`, injectTo: "head" },
          ];
        },
      },
    ],
    server: {
      port,
      allowedHosts: [
        "6d3b-58-97-86-85.ngrok-free.app"
      ]
    },
    preview: {
      port,
      host: "0.0.0.0"
    },
  });
};