/// <reference types="vitest" />
import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vuetify from "vite-plugin-vuetify";
import eslintPlugin from "vite-plugin-eslint";
import basicSsl from "@vitejs/plugin-basic-ssl";
import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
    vuetify({
      autoImport: true,
    }),
    VueI18nPlugin({}),
    eslintPlugin(),
    basicSsl(),
  ],
  define: { "process.env": {} },
  envPrefix: "CORE1_",
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  server: {
    https: true,
    host: "localhost.actindo.ninja",
    port: 5200,
  },
  test: {
    // https://vitest.dev/config/
    environment: "jsdom",
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "node_modules/@actindo/core-ui/variables.scss";`,
      },
    },
  },
});
