import { defineConfig } from "vite";

export default defineConfig({
  build: {
    sourcemap: "inline",
    minify: false,
    lib: {
      entry: "./js/theme.js",
      name: "theme",
      formats: ["iife"],
      fileName: function () {
        return "theme.js";
      },
    },
    outDir: "../assets/js/",
    rollupOptions: {
      external: ["$", "jquery", "prestashop"],
      output: {
        globals: {
          $: "$",
          jquery: "jQuery",
          prestashop: "prestashop",
        },
      },
    },
    write: true,
  },
});
