import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "node:path";

export default defineConfig({
  base: "./",
  plugins: [react()],
  server: { port: 5173 },
  resolve: {
    alias: [
      { find: "@ironcalc/workbook/style.css", replacement: resolve(import.meta.dirname, "vendor/IronCalc/webapp/IronCalc/dist/ironcalc.css") },
      { find: "@ironcalc/workbook", replacement: resolve(import.meta.dirname, "vendor/IronCalc/webapp/IronCalc/dist/ironcalc.js") },
      { find: "@ironcalc/wasm", replacement: resolve(import.meta.dirname, "vendor/IronCalc/bindings/wasm/pkg/wasm.js") },
      { find: "convert", replacement: resolve(import.meta.dirname, "convert/pkg/convert.js") },
    ],
  },
});
