vite.config.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import vue from "@vitejs/plugin-vue"
  2. import dts from "vite-plugin-dts"
  3. import path from "path"
  4. import Icons from "unplugin-icons/vite"
  5. import { defineConfig } from "vite"
  6. import WindiCSS from "vite-plugin-windicss"
  7. import { VitePluginFonts } from "vite-plugin-fonts"
  8. export default defineConfig({
  9. plugins: [
  10. vue(),
  11. dts({
  12. insertTypesEntry: true,
  13. outDir: ["dist"],
  14. }),
  15. WindiCSS({
  16. root: path.resolve(__dirname),
  17. }),
  18. Icons({
  19. compiler: "vue3",
  20. }),
  21. VitePluginFonts({
  22. google: {
  23. families: [
  24. "Inter:wght@400;500;600;700;800",
  25. "Roboto+Mono:wght@400;500",
  26. "Material+Icons",
  27. ],
  28. },
  29. }),
  30. ], // to process SFC
  31. build: {
  32. sourcemap: true,
  33. minify: false,
  34. lib: {
  35. entry: path.resolve(__dirname, "src/index.ts"),
  36. name: "hopp-ui",
  37. formats: ["es"],
  38. fileName: (format, entry) => `${entry}.${format}.js`,
  39. },
  40. rollupOptions: {
  41. external: ["vue", "vue-router"],
  42. output: {
  43. exports: "named",
  44. },
  45. },
  46. emptyOutDir: true,
  47. },
  48. })