import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import vueJsx from "@vitejs/plugin-vue-jsx"; import { resolve } from "path"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue(), vueJsx()], build: { lib: { // Could also be a dictionary or array of multiple entry points entry: resolve(__dirname, "src/lib/index.ts"), formats: ["es"], // the proper extensions will be added fileName: "index", }, rollupOptions: { // make sure to externalize deps that shouldn't be bundled // into your library external: ["vue"], output: { // Provide global variables to use in the UMD build // for externalized deps globals: { vue: "Vue", }, }, }, }, resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, });